The optimal heap size for your deployment ensures that
memory is not wasted or constrained. To determine the optimal heap
size, you enable verbose garbage collection, and then use a support
tool to analyze the results and determine the optimal size.
Procedure
- In the navigation pane of the WebSphere® Application Server administrative
console, select .
- Select the Verbose
Garbage Collection check
box. When verbose garbage collection is enabled, the Java™ virtual machine (JVM) records
information about each garbage collection in a log file. For example, in the log file, you can see the amount of free
bytes and used bytes in the heap, the interval between garbage collections,
and the pause time. Verbose garbage collection has
minimal effect on system performance.
- For Oracle Solaris and
HP-UX,
add the following parameters to the generic JVM arguments:
- -XX:+PrintGCDetails
- -XX:+PrintGCTimeStamps
- -XX:+PrintHeapAtGC
- Apply and save the changes.
- Restart WebSphere Application Server.
- To create log entries to analyze, allow the system
to process
a typical user load for a specified time. The time might be a few
hours or a few days, depending on the user load.
- To determine the optimal heap size, analyze the log file
with a garbage collection analyzer. You can use the IBM® Monitoring and Diagnostic Tools
for Java - Garbage Collection
and Memory Visualizer plug-in, which is available for IBM Support
Assistant.
- For AIX® , Microsoft Windows,
or Linux,
analyze the native_stderr.log file.
- For Oracle Solaris or HP-UX, analyze
the native_stdout.log file.
- Specify new initial and maximum heap sizes and save
your
changes.
- Disable verbose garbage collection.
- Delete the .log file. The .log file
can grow large when verbose garbage collection is enabled.