A5.1 Heap Layout
Option | Default value | Max Value | Description |
-XX:NewSize | 2Mb | < 100 GB | Controls the initial size of young generation |
-XX:MaxNewSize | < 100 GB | Controls the maximum size of the young generation | |
-XX:SurvivorRatio | 8 on windows, and 64 on Solaris | <100000 | Controls the size of the eden and the survivor spaces |
-Xms | 5 MB | < 100 GB | Initial heap size |
-Xmx | 4 MB | < 100 GB | Maximum heap size |
-Xmn | Size of young generation | ||
-XX:MaxTenuringThreshold | 31 | Maximum number of times object is aged. Set this to 0 to enable promoteall. | |
-XX:PermSize | 4 MB | < 10 GB | Initial size of permanent generation |
-XX:MaxPermSize | 64 MB | < 10 GB | Maximum size of permanent generation |
-XX:NewRatio | 2 for server, 8 for client on Solaris | Ratio of young generation / old generation | |
-XX:PretenureSizeThreshold | 0 | Objects size greater than this is directly allocated in the older generation | |
-XX:+UseISM | Use intimate shared memory (see section 16.2.6.1) | ||
-XX:+UseMPSS | Use multiple page sizes (see section 16.2.6.1) | ||
-XX:+UseTLAB | True on Solaris | Use thread-local object allocation | |
-XX:+AggressiveHeap | Use for throughput applications with lots of CPUs and memory > 256MB. Turns on various flags, uses parallel scavenge collector for young generation, turns onAdaptive , increase sizes of TLAB and other data structures | ||
-XX:TargetSurvivorRatio | 50 | 100 | Desired percentage of survivor space used after a scavenge |
A5.2 Parallel Copying Collector
Option | Default value | Max Value | Description |
-XX:+UseParNewGC | Enables young generation parallel copying collector. Use with concurrent collector or default mark-sweep-compact collector | ||
-XX:ParallelGCThreads | As many threads as CPUs | Controls the number of threads used for copying collection |
A5.3 Concurrent Collector
Option | Default value | Max Value | Description |
-XX:+UseConcMarkSweepGC | Enables old generation concurrent collection | ||
-XX:UseCMSCompactAtFullCollection | false | Enable compaction Full GC and if full collection are occurring too frequently | |
-XX:CMSFullGCsBeforeCompaction | 1 | Parameter that affects compaction of the old generation. If at least this number of concurrent collections has not succeeded between full collection, do a compaction on full collections. If 0, always do compactions on full collections whenUseCMS is true | |
-XX:PrintCMSStatistics | 0 | If > 0, Print statistics about the concurrent collections. For example, the number of times the concurrent collection yield to a young generation collection and the number of cards precleaned | |
-XX:PrintFLSStatistics | 0 | If > 0, print statistics about the concurrent free lists. For example, a fragmentation parameter | |
-XX:PrintFLSCensus | 0 | if > 0, print the populations of the CMS free lists | |
-XX:CMSInitiatingOccupancyFraction | 68% | Change the percentage when a CMS collection is started |
A5.4 Parallel Scavenge Collector
Option | Default value | Max Value | Description |
-XX:UseParallelGC | Enables young generation parallel scavenge collector. Works only with the default mark-sweep-compact collector. Do not use with the concurrent collector. | ||
-XX:+UseAdaptiveSizePolicy | false | Automatically sizes the young generation and chooses an optimum survivor ratio to maximize performance. | |
-XX:+PrintAdaptiveSizePolicy | false | Prints information about adaptive size policy | |
-XX:ParallelGCThreads | As many threads as CPUs | Controls the number of threads used for copying collection |
A5.5 Verbose GC options
Option | Default value | Max Value | Description |
-XX:+PrintGCDetails | false | PrintGC details | |
-XX:+PrintGCTimeStamps | false | Adds timestamp info to GC details | |
-XX:+PrintHeapAtGC | false | Prints detailed GC info including heap occupancy before and after GC | |
-XX:+PrintTenuringDistribution | false | Prints object aging or tenuring information | |
-XX:+PrintHeapUsageOverTime | false | Print heap usage and capacity with timestamps | |
-Xloggc:filename | false | Prints GC info to a log file | |
-verbose:gc | false | Prints some GC info | |
-XX:+PrintTLAB | false | Print TLAB information |