Determining optimal heap sizes in WebSphere Application Server

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

  1. In the navigation pane of the WebSphere® Application Server administrative console, select Servers > Application servers > server_name > Process definition > Java Virtual Machine.
  2. 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.
  3. For Oracle Solaris and HP-UX, add the following parameters to the generic JVM arguments:
    • -XX:+PrintGCDetails
    • -XX:+PrintGCTimeStamps
    • -XX:+PrintHeapAtGC
  4. Apply and save the changes.
  5. Restart WebSphere Application Server.
  6. 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.
  7. 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.
  8. Specify new initial and maximum heap sizes and save your changes.
  9. Disable verbose garbage collection.
  10. Delete the .log file. The .log file can grow large when verbose garbage collection is enabled.


Feedback