Re: ggc

From: Erick Gallesio <eg_at_kaolin.unice.fr>
Date: Tue, 04 Jun 1996 16:57:45 +0100

> Jonathan Berry writes
> I am interested in looking at some applications involving quite a few
> thousand STk objects, which leads me to a question about garbage collection.
> I want to use a lot of memory and garbage collect very rarely. I once tried
> changing the heap size to be many megabytes, but it didn't seem to
> make any difference since gc's seemed just as frequent. I really haven't
> had time to determine exactly how the gc mechanism is called. Would
> somebody who knows it better please explain how to tailor it to my needs?
> thanks,

You can change the number of cells which are pre-allocated. Two ways to
do the job:
        - Use the -cells option when running the interpreter (default is 20000
          or 25000) which is small if you use thousands of objects.
        - Use expand-heap to use more cells. For example,
             (expand-heaps 400000)
          will use 400000 cells.

The number of cells grows as necessary (i.e. when more than 75% of the cells
are used after a GC), but there are some situation wher you use a lot of cells
for a computation (generic functions are typical) but there are not a lot of
objets which must be kept after a GC. In this case, you are doing very
frequent GC.

There is also a constant in the interpreter (MAX_MALLOC_BEFORE_GC) which
launch a GC when MAX_MALLOC_BEFORE_GC have been mallocated. This allows to
GC before all cells have been exhausted. You should not be concerned by this
constant which allow to keep the interpreter memory occupation low when you
use a few (very large) objets. Currently, there is no way to change this from
the interpreter.
 
                -- Erick
Received on Tue Jun 04 1996 - 16:57:46 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST