Heap generations and garbage collector tuning - which tools?

F

Federico Cozzi

Hello,
I am trying to tune the garbage collector of a Glassfish-based web
application.
I have collected tons of gc logs and heap sizes. The logs clearly show
that minor collections (young generation) do not collect much and the
heap size keeps increasing until a full garbage collection kicks in.
The heap is 2gb (-Xms and -Xmx). Heap occupancy starts at
approximately 0.5 gb, then it ramps up to 1.5 gb until the full
garbage collection is triggered and it goes back to 0.5 gb. Minor
collections do reclaim some heap but very little: if I plot time
versus heap occupancy on a graph, I get a sawtooth wave (first picture
of http://en.wikipedia.org/wiki/Sawtooth_wave).

This of course could be due to our application's object allocation
pattern. It could be that all our objects are medium-lived, that is
they survive a few young-generation collections until they are
promoted to old-generation, and are collected only during full
collections.

Is there any tool to analyze which objects do not die young?
It would be great to plot a histogram with the average life-span of
objects (grouped by class) - is it possible?

Thanks,
Federico
 
L

Lew

Hello,
I am trying to tune the garbage collector of a Glassfish-based web
application.
I have collected tons of gc logs and heap sizes. The logs clearly show
that minor collections (young generation) do not collect much and the
heap size keeps increasing until a full garbage collection kicks in.
The heap is 2gb (-Xms and -Xmx). Heap occupancy starts at
approximately 0.5 gb, then it ramps up to 1.5 gb until the full
garbage collection is triggered and it goes back to 0.5 gb. Minor
collections do reclaim some heap but very little: if I plot time
versus heap occupancy on a graph, I get a sawtooth wave (first picture
ofhttp://en.wikipedia.org/wiki/Sawtooth_wave).

This of course could be due to our application's object allocation
pattern. It could be that all our objects are medium-lived, that is
they survive a few young-generation collections until they are
promoted to old-generation, and are collected only during full
collections.

Is there any tool to analyze which objects do not die young?
It would be great to plot a histogram with the average life-span of
objects (grouped by class) - is it possible?

<http://java.sun.com/javase/6/docs/technotes/guides/visualvm/
heapdump.html>
<http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html>

If a tenured object holds a reference to a young object the latter
will not be collected during a minor collection.
 
F

Federico Cozzi


Is heap dumping a dangerous action on a running production server?
Unfortunately we are using Java 1.5 where VisualVM is not available.
Can I attach VisualVM to a running 1.5 JVM?
If a tenured object holds a reference to a young object the latter
will not be collected during a minor collection.

Thanks for the tips.

Federico
 
J

John B. Matthews

Federico Cozzi said:
Is heap dumping a dangerous action on a running production server?
Unfortunately we are using Java 1.5 where VisualVM is not available.
Can I attach VisualVM to a running 1.5 JVM?


Thanks for the tips.

It works on Mac OS X 10.5.8. A Java program running in a 1.5 JVM appears
promptly in the "Applications" menu, under "Local".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top