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

Christian Schafmeister <[email protected]> Thu, 05 Jun 2014 07:57:53 -0400
Newsgroups gmane.comp.programming.garbage-collection.boehmgc
Message-ID <[email protected]>
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).

I recently incorporated the Boehm garbage collector into a Common Lisp system that I’ve written in C++ that uses LLVM as the back-end and interoperates with C++.

I’ve exposed the Clang compiler front end and the Clang AST Matcher library to the Common Lisp system and I’ve written a static analyzer to analyze and clean-up the C++ source code for the Common Lisp system (165 C++ source files).

The static analyzer takes about 4 hours to run and when it is done the REPL sits there and the application is consuming about 30 GB (gigabytes) of virtual memory.

I have made all of the objects self-describing so if I could walk the live objects I could count the number of each class (~500 classes) and measure their size.

Either I’ve got some enormous data structures in there that I have forgotten about or heap fragmentation
is very bad.

In case I’m not configuring the Boehm library correctly - here is my configuration.
boehm-setup:
	(cd boehm-$(BOEHM_VERSION); \
		export ALL_INTERIOR_PTRS=1; \
		CFLAGS="-DUSE_MMAP -DMMAP_FIXED -DHEAP_START=0x7AE147AE1000" \
		./configure --with-large-heap=yes --enable-cplusplus --prefix=$(CLASP_APP_RESOURCES_EXTERNALS_COMMON_DIR);)



Best,

Christian Schafmeister

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