Migrating Java Applications to HP-UX
16
option:
-XX:+UseParallelGC
The JVM determines the number of parallel threads using heuristics based on number of CPUs
available. You can also explicitly set the number of parallel GC threads with:
-XX:ParallelGCThreads=n
• Old Generation Concurrent Mark Sweep (CMS) collector (low pause collector).
This collector runs mostly concurrently with the application. It attempts to clean out the Old
Generation before it gets full to avoid the costly Full GC. There are still two stop-the-world
pauses, but they are are very short compared to a Full GC.
To enable CMS, use the JVM option:
-XX:+UseConcMarkSweepGC
Turning on this option automatically enables the following on the New space:
-XX:+UseParNewGC
UseParNewGC is a parallel scavenge specifically intended to work with low-pause CMS.
CMS is initiated when Old Space occupancy reaches a specified percent, determined by
CMSInitiatingOccupancyFraction:
-XX:CMSInitiatingOccupancyFraction=<percent>
CMS reduces large GC pause times, but incurs some additional CPU overhead while the
application is running.
• Old Generation Parallel GC (available in jdk 5.0 and later)
This collector uses multiple GC threads to perform a Full GC when the Old space gets full,
thereby reducing the very long pause times caused by a Full GC.
To enable ParallelOldGC, use the JVM option:
-XX:+UseParallelOldGC
The JVM determines the number of parallel threads using heuristics based on number of CPUs
available. You can also explicitly set the number of parallel GC threads with:
-XX:ParallelGCThreads=n
JVM Heap and GC Parameters
The following are the JVM parameters used to control the heap size and GC policies described
above.
-Xms<size> Total heap size (initial) e.g. -Xmx512m
-Xmx<size> Total heap size (maximum) e.g. -Xms512m
-Xmn<size> Size of New Space e.g. -Xmn128m
-XX:PermSize=<size> Size of PermSpace (initial) e.g. -XX:PermSize=256m
-XX:MaxPermSize=<size Size of PermSpace (maximum) e.g. -XX:MaxPermSize=512m
-XX:SurvivorRatio=<num> Ratio of Eden to one Survivor Space e.g. XX:SurvivorRatio=8
-XX:+UseParallelGC Enable parallel scavenge on New space
-XX:ParallelGCThreads=n Set number of parallel GC threads