Reputation: 3244
Is there a tool which could be used to analyse the objects being created between two separate garbage collection run (= number of objects created and their type) ?
Heapdumps dont really work here as they perform a GC when they're invoked (or at least that's what I observed everytime so far), and I want to see which objects are collected by the GC, not which objects are left after the GC run, if that makes sense.
Upvotes: 4
Views: 886
Reputation: 8552
If you need to know which objects are collected by GC, the 'Unreachable objects histogram' from Eclipse Memory Analyzer may help.
Upvotes: 0
Reputation: 41627
First, when you always observe a full garbage collection before each heap dump, you probably called it like this:
jmap -histo:live $PID
If that's the case, just leave out the :live
, which will suppress the explicit garbage collection.
In addition, the Sun JVM knows the following command line options:
-XX:+PrintClassHistogramBeforeFullGC -XX:+PrintClassHistogramAfterFullGC
That should be pretty much what you want.
Upvotes: 2