JVM Tuning Guidance for Parallel GC on Solaris/SPARC

This guide is specifically for using Java 17 with Ambience/Repertoire 202x on Solaris SPARC when G1GC is unstable, recommending Parallel GC as the fallback.

The listed JVM arguments and guides are commonly used with Parallel GC, every environment is unique and requires thorough testing to determine the optimal configuration for stability.

Argument Description
-Xms24g -Xmx24g Set the initial and maximum heap sizes to be identical. This prevents the JVM from constantly resizing the heap, which reduces pause time variability and overhead
-XX:+AlwaysPreTouch This ensures that all memory pages for the heap are allocated and zeroed by the OS during JVM startup rather than on-demand. This is particularly effective on Solaris for avoiding latency spikes when the application first starts using memory regions.
-XX:ParallelGCThreads=X Adjust this value (X) to the number of active cores, setting this ensures full utilization of hardware parallelism during GC pauses.
-XX:+UseLargePages Solaris SPARC systems typically support large memory pages. Enabling this can significantly improve performance by reducing TLB (Translation Lookaside Buffer) misses. Ensure large pages are also configured at the OS level.
-Xlog:gc*:file=/your/output/path/gc.log:time,uptime,level, tags:filecount=10,filesize=20M This provides detailed GC diagnostics to help you confirm that ParallelGC is performing as expected on your hardware.

Key Recommendations:

  • Heap Settings: Use -Xms24g -Xmx24g to fix heap size and reduce pause variability.
  • Memory Pre‑Touch: Enable -XX:+AlwaysPreTouch to allocate pages at startup, avoiding latency spikes.
  • GC Threads: Set -XX:ParallelGCThreads=X to match active CPU cores for efficient GC pauses.
  • Large Pages: On Solaris SPARC, enable -XX:+UseLargePages (ensure OS‑level support).
  • GC Logging: Configure -Xlog:gc* for detailed diagnostics and review logs regularly.

UAT Best Practices:

  • Mirror Production hardware, JVM build, OS settings in UAT.
  • Replicate traffic and concurrency patterns from Production, including peak loads.
  • Collect and analyze GC logs for pause times, full GC frequency, and memory pressure.
  • Compare Java 17 performance metrics against current Production baseline.
  • Run functional regression tests to validate critical business logic.
  • Ensure data volume parity between UAT and Production databases.
  • Include failure/recovery scenarios (service restarts, network blips).
  • Review logs for ERROR/WARN entries even if reports appear functional.

Note: Consult Solaris vendor for JDK 17 tuning guidance on SPARC systems.

Additional information: