HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 93 (of 101)
Chapter 11 Software Development
October 29, 2013
The new generation heap. New objects are created here. The new space is divided into 2
parts:
o The eden space.
o The survivor space is again divided into 2 parts:
from space
to space
The old or tenured generation heap. Long lived objects will be moved to here.
The permanent generation heap. Java class information is stored here.
During a garbage collection (GC) the JVM moves objects between these spaces depending on
their age, or removes them from the heap if they are no longer in use.
If, as in the output above, the marked lines show 100% used for the old generation heap, the java
heap was full.
For older java versions that do not include this information, the GC log can be checked. To
obtain one, the JVM must have been started with theXverbosegc:<logfile> option. The JVM
will print one line after each garbage collection:
<GC: 2 1 105.263506 4 280008 1 286326784 286326768 286326784 35665424
10691400 35782656 715849656 715849712 715849728 3056752 2899480
16777216 29.482876 29.482876>
Here is the same line again, reformatted for better readability:
before after total
<GC: 2 1 105.263506 4 280008 1 286326784 286326768 286326784 eden
35665424 10691400 35782656 from/to
715849656 715849712 715849728 old
3056752 2899480 16777216 perm
29.482876 29.482876 >
The above line shows that after the GC eden and old space were still full, the JVM was not able
to free space and ran out of memory.
The GC log format may vary from version to version. Details can be found in the output of java
Xverbosegc:help.
In case of an application OutOfMemoryError, the GC log should be analyzed with HPjmeter,
which can be downloaded from the HP java website [1]. Depending on the data from the GC
logs, increasing the java heap (java option Xmx) and/or changing other heap related java options
can be the solution. But the GC log might as well indicate a memory leak in the application. In
this case a java heap analysis might be required to find out what is filling up the heap. This can