chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH] Re: Heap resizing needs to pick up the pac


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] Re: Heap resizing needs to pick up the pace to match mutation stack resizing!
Date: Sat, 30 Jun 2012 13:19:59 +0200
User-agent: Mutt/1.4.2.3i

On Wed, Jun 27, 2012 at 08:18:37PM +0200, Peter Bex wrote:
> I think the patch is a stab in the right direction, but that calculation is
> not near precise enough.  The bug can be triggered more easily by passing a
> low heap growth percentage, for example:
> 
> ./test/finalizer-error-test.scm -:hg110

After discussing this with Felix I came to the conclusion that the
mutation stack is a distraction from the real issue, which is that the
heap size must grow at least enough to contain all the objects from the
nursery.  The attached patch simply checks that at least the nursery
size is added to the current heap size.  The default heap size is also
changed to be equal to the default nursery size.  This means each initial
major GC can be postponed a little while longer.  This should speed up
most programs because the heap won't be way too small like now.

The patch also tweaks the test to run with a VERY small heap growth
(so it includes the patch I posted previously)

There's still something slightly wrong because in abnormal situations
like setting the heap growth to 90%, which actually would be *shrinking*
instead of growing, the test still fails with an OOM error, which
shouldn't happen because this patch ensures the heap will grow at least
enough to accommodate the current heap plus the nursery.  I'm not sure
it's worth worrying about this since a negative growth factor is clearly
bogus and we can declare that a case of "garbage in, garbage out", but
in extreme cases where the nursery is very small this might cause the
bug to reappear.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Attachment: 0001-When-resizing-the-heap-ensure-it-grows-enough-to-acc.patch
Description: Text document


reply via email to

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