[Top][All Lists]

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

[Help-smalltalk] Re: the garbage collector is not doing its job

From: Paolo Bonzini
Subject: [Help-smalltalk] Re: the garbage collector is not doing its job
Date: Fri, 21 Aug 2009 18:02:28 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3

On 01/21/2009 07:20 AM, Derek Zhou wrote:
On Monday 19 January 2009 12:34:02 am you wrote:
I actually applied this patch instead, but you must be thanked anyway
for the debugging.
Another thing is I don't think the _gst_incremental_gc_step function in
oop.c is doing what it means to do:
_gst_incremental_gc_step ()
   OOP oop, firstOOP;
   int i;

   for (i = 0, oop = _gst_mem.highest_swept_oop,
        firstOOP = _gst_mem.last_swept_oop;
        i<= INCREMENTAL_SWEEP_STEP&&  --oop>  firstOOP;
        oop->flags&= ~F_REACHABLE)
       if (--oop>  firstOOP)
           finished_incremental_gc ();

       if (!IS_OOP_VALID_GC (oop))
If you look closely there is no practical way it can get to the
IS_OOP_VALID_GC check, let alone the actual sweeping. However my attempt
of fixing it intuitively caused gst to crash so I don't know...

I think I fixed it now. :-) Just because after six months I had a good reason. :-)

The bug was just that _gst_mem.last_swept_oop was totally wrong and basically worked by chance. Yes, I mean it...

The reason I went back to it, is that I wanted to remove the usleep (1) almost-busy wait (poll every millisecond) for signals done in VMpr_Processor_yield. The changes would be as follows:

1) when GST is idle, it tries doing an incremental garbage collection step, fifty times per second

2) in addition, if there are any, it runs the idle blocks (ProcessorScheduler>>#idleAdd:) round-robin, also fifty times per second.

3) if there is no idle block and the GC is done, however, it can just sigsuspend until the next signal.

I had this ready a while ago except that because of the above bug, it would never finish the incremental GC, and never go sigsuspend. :-(

I'll push after some more testing on Swazoo.


reply via email to

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