Garbage Collectors
Garbage collection is one of the major culprits in any performance bottleneck. The garbage collector tuning must be done after analyzing GC verbose logging. In cycle processing, most of the objects are short lived and these objects die early, as compared to OIPA (PASJava), where we store the objects for the session. Most of the time default GC settings works for cycle. In cases, where GC is underperforming, following are some of the guidelines that can be followed:
-
Ensure correct GC algorithms are used, based on JDK version used (32 bit vs 64 bit) and heap size more than 8gb or less than 8gb. Use CMS (Compact Mark & Sweep) for heap less than 8gb, use G1GC for heap more than 8gb. Preferably use CMS with JDK 7 & 8, with JDK 9 and upwards, CMS is being deprecated and prefer using G1GC, when using Java 11.
-
Ensure, GC pauses are lower, if required, by adjusting young and old generation sizes or ratios.