chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] GC and heap growth percentage question


From: Felix
Subject: Re: [Chicken-hackers] GC and heap growth percentage question
Date: Sun, 24 Jun 2012 13:44:18 +0200 (CEST)

From: Peter Bex <address@hidden>
Subject: Re: [Chicken-hackers] GC and heap growth percentage question
Date: Sat, 23 Jun 2012 23:48:38 +0200

> On Sat, Jun 23, 2012 at 11:03:43PM +0200, Felix wrote:
>> C_heap_growth gives the percentage (relative to the old size) to what
>> the heap should grow in case of a dynamic heap resize.
> 
> It can't grow any more than that during any given GC cycle, unless I'm
> mistaken.

Right, that's the intention.

> 
> C_rereclaim2() is always called with percentage(heap_size, C_heap_growth) as
> its first argument.  This means the "size" argument is 2*heap_size
> Later, new_heapspace is allocated at this size and new_tospace_limit is
> set to new_tospace_start+size.  In really_remark() the size is calculated
> and if new_tospace_top exceeds new_tospace_limit it gives the familiar
> "out of memory - heap full while resizing" error.
> 
> IIUC, this means that whenever more stuff is allocated between two GCs
> (old heap + stack?) than twice the heap, it will fail.  I'm not sure yet
> how this situation would happen, but there are a lot of places which hold
> values that are remarked, so I can imagine there could be situations
> where these taken together are more than twice the current heap.

This would mean either the nursery is bigger than one half of the new
space (very unlikely) or that data is copied more than once (which
would be a bug).
> 
>> You can try using a fixed heap (say, using "-:h500m") - does that make
>> a difference? (the test seems to run ok on my machine).
> 
> Yes, it does not give any error with -:h500m, just like when I pass
> -:hg250 or higher.

What happens when you use different settings for "-:f"? Is this only
finalizer-error-test that fails? Are you sure you are building it with
the correct compiler? Have you bootstrapped recently? Are you not
mixing up different runtime library versions?


cheers,
felix



reply via email to

[Prev in Thread] Current Thread [Next in Thread]