Re: [Gc] Is there a way to walk the entire heap of live objects

Paul Bone <[email protected]> Mon, 16 Jun 2014 22:03:59 +1000
Newsgroups gmane.comp.programming.garbage-collection.boehmgc
Message-ID <20140616120359.GA8552@durif>
On Fri, Jun 06, 2014 at 02:16:27PM +1000, Peter Wang wrote:
> On Thu, 05 Jun 2014 07:57:53 -0400, Christian Schafmeister <[email protected]> wrote:
> > Hi there,
> > 
> > Is there any functionality in the Boehm GC that would allow me to
> > freeze the garbage collector and walk the heap of live objects?    I’d
> > like to take an inventory of all of the live objects to determine the
> > source of my current memory problems (30 GB of virtual memory used
> > after 4 hours of runtime).
> 
> Hi,
> 
> We do something like that in the Mercury project using the following
> function.
> 
> I am not an expert on Boehm GC internals, and the code is only used in a
> special memory profiling grade, so not heavily exercised.
> Please let me know if there is something wrong with it.
> 

I'm chasing down a bug that I think is in Boehm GC and affects Mercury.  
I'm going through the various changes that we've made to the collector
including Peter's change and rebasing them onto version 7.4.2 (they were on
7.2).

Here is Peter's code for enumerating reachable objects as a patch on version
7.4.2 incase anyone finds it useful or would like to include it upstram.

https://github.com/PaulBone/bdwgc/tree/peter_trace_heap

Thanks.

-- 
Paul Bone
_______________________________________________
bdwgc mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/bdwgc