Garbage Collector

js.mdnq js_adddot+mdng at gmail.com
Fri Nov 30 15:21:38 PST 2012


I came across these threads:

http://stackoverflow.com/questions/13574552/d-programming-without-the-garbage-collector

http://stackoverflow.com/questions/8782627/does-the-d-garbage-collector-work

and did some investigating of my own.

I noticed that in both x64 and x86 builds the GC seems to get 
exponentially slower as the objects are allocated.

On the x64 version with about 6GB(about 7GB free, no page 
file(turned off)) usage the time I see the object allocation(by 
watching memory usage) slow to a craw after about 1GB and it just 
gets slower(in some cases allocating about 10k/s(vs about 100MB/s 
at the start).

GDC reduces does slightly better but still the same issue.

Since the sample code allocates objects sequentially without any 
deallocation it seems there is a huge "bug" in the GC code.

Maybe the GC does not handle allocating a large sequence of 
objects well because it expects some deallocations in between?

Can we expect improvements of the GC at in time in the near 
future(months, not years)?




More information about the Digitalmars-d mailing list