[gclist] GC debug (was: What to say about GC)

Darius Blasband darius@phidani.be
Tue, 30 Jul 1996 09:52:39 +0200 (MET DST)


> 
> William R. Dieter wrote:
> > I, too, would be interested in hearing what other people do to debug.
> 

The major problem we have been facing when dealing with GC was
memory leak. I do realize of course it sounds strange, but it
is the truth. Well, admittedly, these memory leaks were not
memory leaks in the common C sense.

Our problem can be stated as follows: everything has been done
in such a way that a complex data structure is not referenced
anymore, we would like the GC to deallocate it, and it simply
doesn't. There is a live reference to this data structure, and
we are having quite a hard time trying to find this reference
in order to be able to erase it, so that our big data structure
can be deallocated.

Since we are working with a home made precise garbage collector,
we made a debugging version of it that generates a dump of the
marking process, so that we can find the root that leads to
the unwanted objects.

This technique has been used in several occasions where we simply
had no idea of where the problem was, with working sets of over
100000 allocations.

Since we are working in a extremely safe environment (no pointer 
aithmetics, systematic range checking for array accesses, etc...) 
we have not been experiencing any of the memory corruption problems
one can encounter in a C/C++ world.

Well, that's it for today.

Regards,

Darius