[gambit-list] Any procedure/debug way to see what objects reference an object?

Marc Feeley feeley at iro.umontreal.ca
Tue Jun 18 12:19:48 EDT 2013


On 2013-06-18, at 8:51 AM, Mikael <mikael.rcv at gmail.com> wrote:

> Dear Marc,
> 
> I'm having a memory leak issue that takes hours and hours to resolve.
> 
> Is there any way to traverse the heap as to find the object that references a particular object?
> 
> E.g.  (object-references object) => referencing-objects-list
> 
> 
> It's completely OK if it requires scanning all the heap :}
> 
> If it's not in Gambit already, I guess one such routine could be created easily-enough based on the GC mark routines.

It is not in Gambit, but it would be easy to modify the GC to do this.  By the way, your proposed API is not quite right because the references can be in non Scheme objects (for example global variables, a stack frame, a C allocated object).  Also, it could be that the object is a ___STILL object that has a non-zero reference count.  So a leak is possible if there's a missing reference count "decrement" in the code.

Marc





More information about the Gambit-list mailing list