new14 new14 - 3 months ago 19
Java Question

Interpreting jstat results

I am new to jstat tool. Therefore I did a sample as below.

./jstat -gcutil -t 4001 5000
Timestamp S0 S1 E O P YGC YGCT FGC FGCT GCT
565088.4 0.00 0.89 75.86 40.59 84.80 405 3.822 4 0.549 4.371
565093.4 0.00 0.89 77.81 40.59 84.80 405 3.822 4 0.549 4.371
565098.4 0.00 0.89 77.81 40.59 84.80 405 3.822 4 0.549 4.371
565103.5 0.00 0.89 77.85 40.59 84.80 405 3.822 4 0.549 4.371
565108.5 0.00 0.89 77.85 40.59 84.80 405 3.822 4 0.549 4.371
565113.4 0.00 0.89 77.85 40.59 84.80 405 3.822 4 0.549 4.371


jstat -gc output

S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT
704.0 704.0 0.4 0.0 6080.0 4013.8 14928.0 6335.2 21248.0 18019.6 436 3.957 4 0.549 4.506
704.0 704.0 0.4 0.0 6080.0 4016.6 14928.0 6335.2 21248.0 18019.6 436 3.957 4 0.549 4.506
704.0 704.0 0.4 0.0 6080.0 4135.4 14928.0 6335.2 21248.0 18019.6 436 3.957 4 0.549 4.506
704.0 704.0 0.4 0.0 6080.0 4135.4 14928.0 6335.2 21248.0 18019.6 436 3.957 4 0.549 4.506
704.0 704.0 0.4 0.0 6080.0 4135.4 14928.0 6335.2 21248.0 18019.6 436 3.957 4 0.549 4.506
704.0 704.0 0.4 0.0 6080.0 4135.4 14928.0 6335.2 21248.0 18019.6 436 3.957 4 0.549 4.506


What does this results indicates? Which are the columns to look out for possible memory problem e.g. memory leak etc.

Answer

See the documentation:

http://docs.oracle.com/javase/6/docs/technotes/tools/share/jstat.html#output_options

Basically one row is one point in time. The columns show data aboutr the JVM memory areas (Survivor, Eden, ...), understanding them is impossible without knowing how the JVM works.

For example in the article JVM garbage collection in young generation there is some explanation.

Here is the excerpt how JVM object generation works:

Eden is a place where new objects created. When the Eden is full, a small GC is run: if an object has no reference to it, it will be deleted, otherwise it will survive, and move to the Survivor space (only one of the survivor spaces in use at a time, all objects from the other space is copied there).

If an object survives a certain number of back-and-forth copying, it is moved to Old space. If the Old space is full, a Full GC is run, which affects all objects in the JVM, so it is much heavier operation.

Also, there is the Permanent space, where the "metadata" (class descriptors, field, method, ... descriptors) are stored.

Comments