Skip to content
Prev 22727 / 63421 Next

allocVector bug ?

On Wed, 1 Nov 2006, Vladimir Dergachev wrote:

            
This is as intended, not a bug. The garbage collector does not "go
nuts" -- it is doing a garbage collection that may release memory in
advance of making a large allocation.  The size of the current
allocation request is used as part of the process of deciding when to
satisfy an allocation by malloc (of a single large noda or a page) and
when to first do a gc.  It is essential to do this for large
allocations as well to keep the memory footprint down and help reduce
fragmentation.

The strategy for deciding when to allocate and when to gc is by
necessity heuristic.  It tries to keep overall memory footprint low
but at the same time tries to adapt to usage so that gc happens less
oftn once a pattern of using larger amounts of memory emerges. The
current strategy seems quite robust across a large range of
architactures, memory configurations, and applications.

That said, when I wrote the mamager I kept in mind that we might
eventually want to try morre sophisticated schemes and/or allow some
user control over the schemes used.  It may be time to revisit this
soon.

luke