Concurrent GC (for Windows)

Rainer Schuetze via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 4 13:37:17 PDT 2014



On 04.06.2014 08:51, Jacob Carlborg wrote:
> On 03/06/14 09:35, Rainer Schuetze wrote:
>> Hi,
>>
>> more GC talk: the last couple of days, I've been experimenting with
>> implementing a concurrent GC on Windows inspired by Leandros CDGC.
>> Here's a report on my experiments:
>>
>> http://rainers.github.io/visuald/druntime/concurrentgc.html
>>
>> tl;dr: there is a working(?) partially concurrent GC here:
>> https://github.com/rainers/druntime/tree/concurrent_gc2
>> but it eats a whole lot of memory.
>
> How does other GC's handle these memory problems? I'm thinking of Java
> and C#, or do they have some advantage of being run in a virtual machine?
>

All more sophisticated GCs have write or read barriers. That makes it 
much easier to keep track of modifications during concurrent collection.

One reason for the huge memory foot print is that the application is 
allowed to continue to allocate during collection, but it will do this 
by getting more memory from the OS. It needs to be somehow throttled to 
avoid going too far with this.

Most of the remaining pause time is sweeping garbage. I think about 
deferring sweeping into allocations by running finalizers just before 
reusing the memory for another object. This can throttle allocations a 
bit while at the same time reduce pauses.


More information about the Digitalmars-d mailing list