[gclist] Two conservative collectors

Matthew P. Gordon mpg@geodesic.com
Thu, 18 Nov 1999 13:16:48 -0600


Charles Fiterman wrote:
> As to traceback info, to be useful this involves understanding data
> definitions. I'm sure you can give it in hex but what earthly good is that
> to humans. Traceback has to say things like
> 
>   filex.cpp:17 frobNick *foo == 0x127080 (vtbl frobNick)
>   0x127088 (char *)name == 0x141200 (no vtbl)
> 
> You would be saying
> 
>   0x560800 == 0x127080
>   0x127088 == 0x141200

	I actually went a step further and combined Charles' and Hans'
suggestions in a prototype branch I built of Great Circle.  I used an
(almost) empty field in an object header to stash back pointers (Hans
suggested this on the list a while back), and I used Great Circle's
gcPrintObject facility to give full symbolic stack traces of each object
in the traceback.  I found that the majority of the time that objects
were being retained when there wasn't any obvious reason for them to be
retained it was because of what Charles calls "holes in the stack,"
where bits of the stack are used to pass arguments, and then
subsequently unused for long periods of time due to compiler
optimizations which align things on the stack.
	A big problem with this nifty little prototype was that the there was
no good way to visualize the heap.  I built in a function which would
just dump the backpointers and the stack traces, but this is hard to
work with.  On the other end of the spectrum, I was considering using
VRML to get a full, three dimensional look at the stack.  But, this
seemed a bit fantastic, and difficult to implement.  There were some
other suggestions, but I'm interested in hearing if anybody has
experience with good (or bad!) interfaces to total-heap visualization
schemes like this.