WebSphere Application Server & Liberty

 View Only

IBM Expert TV: Tune Java Garbage Collection to improve performance

By Kevin Grigorenko posted Thu April 14, 2022 10:44 AM

  
On Wednesday, April 13th, 2022 at 11:00 AM ET, we presented "Tune Java Garbage Collection to improve performance" on IBM Expert TV.


In the presentation, we discussed key aspects of garbage collection tuning to improve performance. We started by explaining that garbage collection (GC) is a critical component of Java performance which generally cannot be disabled, so it must be tuned. It's important to be data driven and the key data for tuning GC is verbose GC. This generally has an overhead of less than ~0.2% and is recommended for all environments. Next, use the free IBM Garbage Collection and Memory Visualizer tool to load the verbosegc files and review the proportion of time spent in garbage collection. A healthy proportion is generally less than 5-10%. If you observe a greater proportion, then consider various strategies for tuning:

  1. Consider testing different garbage collectors themselves; on IBM Java and Semeru/OpenJ9, those include gencon (default), balanced, optthruput, optavgpause, and metronome.
  2. The maximum heap size is tuned with -Xmx or -XX:MaxRAMPercentage
    1. If used tenured heap > ~70% after global GCs, test increasing max heap size
  3. The maximum nursery size is tuned with -Xmn (defaults to 25% of -Xmx)
    1. If used tenured heap < ~40% after global GCs, test increasing max nursery size
  4. Check for long GC pauses - find/fix cause
    1. Eliminate system GCs
    2. Reduce class loading/unloading churn
    3. Make sure Java process size fits in RAM; paging has massive performance impact
  5. Gencon: If you're willing to trade throughput/CPU for reduced nursery pause times, test -Xgc:concurrentScavenge

#websphere#WebSphereApplicationServer#WebSphereLiberty#experttv#Java#performance​​​​​​#WebSphere-performance#java-performance

Permalink