Garbage collector memory leak "feature"?

Steven Schveighoffer schveiguy at yahoo.com
Wed Oct 10 06:29:49 PDT 2007


Something has come to light in a few posts that has described memory leak 
problems because the garbage collector finds ghost pointers in hash data. 
My understanding of the problem is that the garbage collector marks data 
allocations as having pointers or not having pointers, and then searches 
through all the data to see if there are any valid pointers, finding data 
that looks like a pointer, but is not. (BTW, this seems inefficient to me, 
but I have no idea how to write a garbage collector)

The most disturbing thing I've seen in these posts is the assumption that 
this is just the way the garbage collector is, and shame on me for writing 
code that fools it.

So I have some questions, coming from someone who knows nothing about 
writing garbage collectors, but loves the usage of them.

1. Is this just the way all garbage collectors are?  Is there not a way to 
solve this problem?
2. Does Tango have this problem?  I know the GC's are different, and I use 
tango, so maybe I could just say, too bad for phobos users and be on my way 
:)
3. If it is solvable, is anyone working on this?  If not, they should be. 
Add this to the list of things that need to be fixed before D has widespread 
adoption.  Memory leaks == bad bad bad.

-Steve 





More information about the Digitalmars-d mailing list