[Gc] Re: GC behaviour of gcj programs

Hans Boehm Hans.Boehm@hp.com
Fri, 7 Nov 2003 21:10:44 -0800 (PST)

I would call GC_expand_hp to immediately expand the heap to the
target size, and then proceed as you suggested.  You should be
able to get the same effct with the GC_INITIAL_HEAP_SIZE env.
variable.  (For 3.4, the maximum can also be set this way.)

I'm not sure why setting GC_free_space_divisor to one and limiting
the heap size doesn't work.  I haven't experimented with it either,
but I wouldn't have expected it to crash.  Posting details to
gc@linux.hpl.hp.com might be helpful.

GC_free_space_divisor is used in a pretty trivial way, though the
code surrounding it isn't.  It would be easy to give it more resolution
by scaling it or using fp arithmetic.  (The standard distribution
avoids fp arithmetic, but that's only useful for a few platforms.)

GC_oom_fn is called once all the relevant decisions have already been
made.  I wouldn't expect that to work.


On Thu, 6 Nov 2003, Robin Garner wrote:

> I'm trying to look into the performance of gcj programs under varying
> heap sizes, and I'm wondering if it's possible to persuade the collector
> to run with a fixed sized heap.
> My first attempt was to do
> GC_set_max_heap_size(bytes);
> GC_use_entire_heap = 1;
> but it seems that the heap won't grow beyond the threshold set by
> GC_free_space_divisor.  If I set GC_free_space_divisor to 1, then the
> program falls over when it reaches the heap size.  Setting the heap size
> and adjusting the heap divisor works just fine, it's just that the
> behaviour in a fixed size heap doesn't match expectations.
> I've tried replacing GC_oom_fn with one that forces a collection, then
> GC_mallocs, but this doesn't seem to work the way I expect.
> I'm doing this via CNI calls through to the Boehm GC's API.  If the
> free_space_divisor was a float I would also be happy(ish), but for me
> the most interesting values of it are between 1 and 2, and 2 and 3.
> Any assistance appreciated.  Gcc 3.3.
> -- Robin
> --
> __________________________________________________________
> Sign-up for your own personalized E-mail at Mail.com
> https://www.mail.com/?sr=signup
> Search Smarter - get the new eXact Search Bar for free!
> https://www.exactsearchbar.com/