How can we see what objects are in specific generations in JVM?

Go To StackoverFlow.com

2

Is there a way to see what specific objects are in which specific generation (eden, old, etc) in JVM? I am trying to figure out a way to see where exactly which objects are being problematic. I am using JProfiler, recording memory will tell you the live and GCed objects at any point of time, but doesn't tell you which generations the objects are in. Any other tool that tells this? I can't seem to find any such GC debug option also.

On a side note, recording memory with JProfiler seems to be having too much overhead on the application so either I am unable to record memory for a long time (reaches peak memory quickly) or the overhead somehow interferes with/affects the application behavior. Also, recording memory. Any suggestions on this (Am I missing switch to avoid this)? I generally Dynamic Instrumentation option, but as far as I can remember the couple of times I used Sampling also had the same effect.

2012-04-05 15:16
by prams


0

yourkit is able to do what you want. To be more precise, you can see minor and major garbage collections.

Edit: Some people in SO agreed with me. Which Java profiler is better: JProfiler or YourKit?

2012-04-05 15:18
by UmNyobe
Thanks, will check YourKit out - prams 2012-04-09 22:16
@UmNyobe Are you referring to this feature? http://www.yourkit.com/features/index.jsp#generation - fglez 2013-03-07 10:32
this one http://www.yourkit.com/docs/java/help/gc_telemetry.gi - UmNyobe 2013-03-07 10:35


0

enable the jvm flag for printing GC: -XX:-PrintGCDetails Print more details at garbage collection. Manageable. (Introduced in 1.4.0.)

another thing that you can do is using JVisualVM (build it in the jdk1.6) with the visual GC plugin: http://visualvm.java.net/plugins.html

2012-04-05 15:24
by shem
Ads