Java in Containers Recipes
IBM and Semeru Java in Containers Recipe
- Review the general Java recipe for your
JVM. The highlights are to tune the maximum heap size (
-Xmx
or-XX:MaxRAMPercentage
), the maximum nursery size (-Xmn
) and enable verbose garbage collection and review its output with the GCMV tool. - In general, tune
-XX:MaxRAMPercentage
and-XX:InitialRAMPercentage
instead of-Xmx
and-Xms
, respectively, to allow for more flexibility with sizing of containers at the host level. Default values depend on any container memory limit. - Consider using
-XX:+ClassRelationshipVerifier
to improve start-up time. - If using Semeru Java >= 11 and memory in the pod is limited, consider using the remote JITServer on available platforms to avoid potential throughput issues.
- Review and test different CPU limits. Steady state requirements may be different from startup requirements, particularly due to JIT compilation (unless using JITServer).
For details, see the Java J9 in Containers chapter.