Heap profiling, of sorts

Boehm, Hans hans.boehm@hp.com
Thu Mar 18 23:04:00 GMT 2004


Several people pointed out significant bugs in my earlier patch.  (It didn't build with
-DLARGE_CONFIG, and it sometimes generated spurious error messages related to
"finalization" of statically allocated objects.)

Here's version 2. It should fix these problems.  And it tries to print Java types
as part of object descriptions.  (Comments on the implementation of gcj_describe_type_fn
in boehm.cc are especially appreciated.  There may be easier/better ways to do this.)
With this change this should be somewhat useful even on platforms where the GC doesn't
know how to unwind the stack.

It prints Java class names (after the allocating file and line number) if the object is
allocated with a gcj-style descriptor.  Note that arrays of objects tend to instead be
allocated as NORMAL (i.e. conservatively scanned, since they are guaranteed to introduce
no possibility of false references, and contain almost all pointers.)  Thus you should
typically read "NORMAL" as "Java array".

If there are no objections/corrections, I will check this into the trunk in a few days.

Hans

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gc_diffs2_ChangeLog
Type: application/octet-stream
Size: 3159 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20040318/03a75107/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gc_diffs2
Type: application/octet-stream
Size: 42140 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20040318/03a75107/attachment-0001.obj>


More information about the Java mailing list