Specifying a sufficient JVM Heap Size is important to Java performance.
The JVM has thresholds it uses to manage the JVM's storage. When the thresholds are reached, the garbage collector (GC) gets invoked to free up unused storage. GC can cause significant degradation of Java performance.
Use the administrative console to specify the Initial Heap Size and the Maximum Heap Size for the JVM.
To view this administrative console page, click Servers > Application Servers > server_name. . Then, under Server Infrastructure, click Process Definition > Control > Java Virtual Machine. Access the configuration tab to change these settings.
<af type="tenured" id="7" timestamp="Mon Nov 14 22:58:18 2005" intervalms="3724.328"> <minimum requested_bytes="72" /> <time exclusiveaccessms="0.034" /> <tenured freebytes="4026368" totalbytes="134217728" percent="2" > <soa freebytes="0" totalbytes="130191360" percent="0" /> <loa freebytes="4026368" totalbytes="4026368" percent="100" /> </tenured> <gc type="global" id="7" totalid="7" intervalms="3724.645"> <refs_cleared soft="0" weak="10" phantom="29578" /> <finalization objectsqueued="0" /> <timesms mark="76.550" sweep="6.021" compact="0.000" total="82.939" /> <tenured freebytes="87995424" totalbytes="134217728" percent="65" > <soa freebytes="85311520" totalbytes="131533824" percent="64" /> <loa freebytes="2683904" totalbytes="2683904" percent="100" /> </tenured> </gc> <tenured freebytes="87994768" totalbytes="134217728" percent="65" > <soa freebytes="85310864" totalbytes="131533824" percent="64" /> <loa freebytes="2683904" totalbytes="2683904" percent="100" /> </tenured> <time totalms="83.290" /> </af>
83.29/3724.32 * 100 = 2.236%
If you are spending more than 5% of your time in GC and if GC is occurring frequently, you may need to increase your Java heap size.
To determine this, look at the %free. You want to make sure the number is not continuing to decline. If the %free continues to decline you are experiencing a gradual growth in allocated heap from GC to GC which could indicate that your application has a memory leak.
You can also use the MVS console command, modify display, jvmheap to display JVM heap information. See "Modify command" for details. In addition, you can check the server activity and interval SMF records. The JVM heap size is also made available to PMI and can be monitored using the Tivoli Performance Viewer.