[Gc] Roots observed in GC stack with threads

Petter Urkedal urkedal at nbi.dk
Tue Nov 27 10:53:11 PST 2007


On 2007-11-26, Lincoln Quirk wrote:
> The program is in a complex infinite loop which results in several
> allocations each iteration. The essence of it is that it's constructing
> a new node in a linked list on each iteration, but the head is being
> advanced as fast as the tail. I (fairly strongly) believe I'm updating
> any pointers to the old head, so that the old elements in the list
> should not be retained and the collector should properly collect it as
> execution continues.

When you unlink list nodes, do you zero the next-pointers?  Otherwise,
one wrongly retained node will cause the rest of the chain to be
permanently retained.


More information about the Gc mailing list