Search code examples
javagarbage-collectionjvmjvisualvmjmap

Statistics of objects in old generation?


Is there any tool to view object statistics on the different generations of a JVM Heap? I'm looking into a potential memory leak and need some data over the different generations. The use case I have is to take a snapshot over object in old generations, wait, and then take another snapshot to compare.

JVisualVM offers statistics over created object, but that doesn't help me much as I don't see whether or not a particular object is being promoted or tenured faster than it should.

Jmap offers statistics over the different generations, but not on an object basis. In that tool I can only see that the old generation is growing...


Solution

  • Run your app on Yourkit .It has got generation view tab.You can take snapshots of your heap and compare what objects are still alive between snapshots .

    Documentation

    Here is an useful answer by @JT .

    For more info check this link