This is a recompilation of information collected from the D newsgroups, related to garbage collection (and sometimes memory management in general).
These are posts with programs that (used to) break the current D GC implementation (or expose some serious inefficiencies).
The problem with the D GC: exposes a problem with large random data (fixed).
Re: DMD 1.003 release: exposes the same problem as the previous post (fixed).
Problems with GC, trees and array concatenation: looks like the same problem of previous posts but specific to some Tango_ IO implementation (didn’t checked, but I guess it’s fixed in Tango_).
Slow GC?: exposes slow lookups in the page table of the GC, a proposed patch with a simple but effective optimization is attached to the bugzilla issue (fixed in Tango, still broken in both D1 and D2 phobos).
[Performance] shootout.binarytrees when implemented with gc is 10x slower than C# on .NET 2.0: (I didn’t test the C# version to compare, but I guess it’s not fixed).
thread and gc.fullCollect: some weird problem that seems to be because of the signal used by the GC for “stopping the world”.
GC implementation: security concerns about the current conservative GC implementation
Any advice for GC/memory debugging: tips about debugging memory leaks in the GC.
Threading and the Garbage handler mess.: problems (and solutions) interacting with C libraries (that stores pointers) and threads.
Keeping a list of instances and garbage-collection: problems on weak-references support in the current GC.
GC object finalization not guaranteed: discussion about the current D specs making no guarantees about finalization.
For Leandro: A tiny benchmark that shows a small performance loss in the D2 GC.
Full Reflection Gets You Smarter GC: some random ideas about using the members-tuple feature to implement a (more) precise GC.
Is a moving GC really needed?: some discussion about {ad,dis}vantages and possibilities of a moving GC.
GC, the simple solution: same but for reference counting.
How does RTTI help gc?: some thoughts about how and why RTTI helps precise GC.
Transitioning to a type aware Garbage Collector: Walter Bright announces that the GC will not scan anymore memory used by arrays of scalar types (only void[] and structs/classes are scanned).
Partially Static GC: propose to do static analysis to free automatically free memory at compile-time.
Moving GC: general discussion about making D support a moving collector (there is a bugzilla issue with a list of items D need to add to support it).
Re: GC implementation, Interface: proposal of a GC interface that allows multiple GC families implementations (RC, M&S, moving, etc.).
Std Phobos 2 and logging library?: : discussion about improvements to the runtime to allow more precise GC (real GC discussion starts here ).
-nogc: add on-demand reference counting support by wrapping reference handling in a Ref!T type.
Associative Arrays and Interior Pointers: suggests adding a new GC block
attribute NO_INTERIOR
to indicate that an object can’t have interior
pointer so it can be handle better by the GC avoiding keep live data because
of false pointers.
A possible GC optimization: suggests an optimization that’s new to Python 2.7 GC.
Or interesting in any other way :)
Re: Compiling DMD parser?: an example of using the DMD frontend to parse D code and get warning about unused variables (link seems to be dead).
D GC Benchmark Suite: Vladimir Panteleev talks about its “Diamond”:http //dsource.org/projects/diamond post-mortem memory debugger and profiler project.
D2 weak references: discussion on how to implement weak references and how they should be part of the collector because they are so tied together.
This are links I got from the newsgroup for which I didn’t save the original post.
Slow D: some benchmarks (source available) that shows how D can be improved.
A little tutorial on the D GC: a D program/tutorial on how to make advance use of the GC.
Spec needs allowances for copying garbage collection: bugzilla issue listing that should be added to the specs in order to support copying/moving collectors.
GC Benchmark: Tango vs. Phobos mini GC benchmark.
Immix garbage collection: Keith Nazworth announces he wants to start a new GC implementation.
import std.stdio;
class C
{
int i;
void* p;
}
void main()
{
foreach (i,e; typeof(C.tupleof))
writefln(e.stringof, " ", C.tupleof[i].offsetof);
}