[Gc] Re: Understanding why GC'ing increases to the double in time?
Martin Egholm Nielsen
martin at egholm-nielsen.dk
Mon Feb 13 12:27:57 PST 2006
>>Would it be possible (with a reasonable amount of hacking, that is), to
>>measure the time spent in "mark_from" (if this is where time is spent),
>>and then return if more than X ms has passed, and the resume from that
>>point(er) the next time there is time. And perhaps to make a full
>>collect every 20'th time.
>>In order not to spent all the time looking up time-spent, this could be
>>flavoured with a couple of training runs perhaps learning how many
>>cycles of the for-loops can be finished before actually checking
>>I know this is an extreme embedded-tailoring of the GC, but is it at all
>>possible to do?
>>Perhaps it would never work since the "reference counting" phase will
>>never complete, hence not knowing if any segment can be released...
> Actually, the collector's incremental mode is similar to this.
I kinda feared that, but since the incremental is not supported by GCJ
yet, I hoped my scenario was a strong simplified version...
> The difficulty is that when you stop marking and let the client run
> for a while, you end up with marked objects no longer on the mark stack
> pointing to unmarked objects, which then get missed by the marker
> altogether and reclaimed prematurely. Just restarting the marker
> after a while is not correct.
Ohh, I see!
> To handle this correctly, you need some way of tracking data structure
> changes made by the client. The incremental collector does this by
> tracking written (dirty) pages.
> An alternative is to just start over and drop the previous marking work
> when the client code needs cycles. That's also already supported, but
> only works if the client resularly has enough idle time to allow the GC
> to complete.
Now, that sounds like an idea - but how do you interrupt when it's
going, and the (Java/application-) world is stopped?
This is really beginning to sound interesting to me, because my
interruptions are caused by external "interrupts"...
Thanks for you patience Hans,
More information about the Gc