D runtime Garbage Collector details

James Miller james at aatch.net
Thu Feb 23 19:07:55 PST 2012


On 24 February 2012 12:49, Vadim <vadim.goryunov at gmail.com> wrote:
> I am looking for the details on D Garbage Collection implementation. I will
> much appreciate if someone suggests the answers or give some links to
> existing documentation clarifying the following points:
>
> 1. Is it Mark-n-Sweep or copy or generational collector or simple reference
> counting? Or anything else? Any documentation on this would be very helpful
>
> 2. Sun/Oracle JVM publishes a number of counters in shared memory so that
> user may easily monitor the memory usage and the GC statistics real-time
> without affecting the application (and without modifying the application).
> Is there anything similar for D GC?
>
> 3. Is there any performance tests of D GC efficiency? Is it possible to
> write GC-predictable code (without manual allocate/free) or at least do
> something like System.gc()?

I don't know the answers to 1 or 2, but I know that there is a GC
class with a bunch of methods on it for controlling the GC, including
enabling and disabling it and getting GC-allocated memory. Whether
that helps you write GC predictable code - I don't know, garbage
collection is mostly a black art to me :-)

--
James Miller


More information about the Digitalmars-d-learn mailing list