Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
Frits van Bommel
fvbommel at REMwOVExCAPSs.nl
Wed Mar 19 12:37:37 PDT 2008
Sean Kelly wrote:
> == Quote from Craig Black (craigblack2 at cox.net)'s article
>> "renoX" <renosky at free.fr> wrote in message
>>> Uh? Does Windows VM provides enough information as needed by the GC in the
>>> paper or are you thinking about a totally different GC?
>> Are you asking me or Sean? Sean made the claim that "Windows isn't terribly
>> difficult". If he's right, then Windows provides some sort of provision for
>> VM querying for stuff like this.
>
> There are a number of papers on this topic--one being the paper linked in that blog and I believe Hans
> Boehm wrote another one. From what I remember of them, I believe they said that Windows exposes the
> necessary hooks already, but a kernel recompile was necessary to do the same thing on Linux. That
> sounds right as well, since a kernel recompile isn't really possible on Windows anyway, so either the
> feature would be available or it wouldn't. The real work would be a fundamental rewrite of how the
> mark phase operates. For a dedicated programmer, I'd estimate it would take about a week.
IIRC (I read the paper a while back) a full implementation of their idea
is a moving GC[1] which may take a bit longer to implement. It not only
impacts the mark phase, but also the sweep phase[2] and it requires
compiler modifications as well; it'll need to supply the GC with exact
information about pointers in static data, on the heap and on the stack.
Though I might be wrong; anyone care to implement this in GDC (+ gphobos
and/or tango)? :)
[1]: IIRC: When the OS indicates to their GC that it's about to swap
some of their pages out, it starts a collection and attempts to move the
live objects from multiple partially-used pages into fewer pages so the
now-free pages can be released to the OS to prevent the swapping from
taking place (or swap out the now-empty page they'll then avoid using,
I'm not sure exactly).
The cool thing is that they apparently managed to get that working
pretty well while mostly avoiding pages being swapped back in because of
collection activity.
[2]: The equivalent of the current sweep phase will need to move objects
and update all pointers to them, without modifying values that only look
like pointers.
More information about the Digitalmars-d
mailing list