Additional garbage collection runtime options

The GC runtime options in Table 6-2 are available to all four GC policies. They may be used to overcome special problems specific to a particular application.

Table 6-2

Runtime option User Guide description Use when
-Xconcurrentbackground<number> Specifies the number of low priority background threads attached to assist the mutator threads in concurrent mark. The default is 1. Increasing this value does not provide better performance. Changing this value is not recommended.
-Xconcurrentlevel <number> Specifies the allocation "tax" rate. It indicates the ratio between the amount of heap allocated and the amount of heap marked. The default is 8. Changing this value from the default is not recommended.
-Xdisableexcessivegc Disables the throwing of an OutOfMemoryError if excessive time is spent in the GC. By default, this option is off. Use this option only when an OutOfMemoryError is not desired during excessive GC.
-Xdisableexplicitgc Signals to the VM that calls to System.gc() should have no effect. By default, calls to System.gc() trigger a garbage collection. Use when application contains excessive calls to System.gc(). Normally, applications should never call System.gc().
-Xgcthreads<number of threads> Sets the number of helper threads that are used for parallel operations during garbage collection. By default, the number of threads is set to the number of physical CPUs present -1, with a minimum of 1. The default is the best option to use. For multi-processor installations, the number may be reduced to help application performance, if GC performance is adequate.
-Xnopartialcompactgc Disables incremental compaction. Use only as a last resort on a fragmented heap since this option forces full compaction.
-Xpartialcompactgc Causes incremental compaction to occur on every GC cycle. Partial compaction happens by default, but will occur only when necessary - such as when the heap is fragmented. Normally not necessary to set. Use only as a last resort if heap fragmentation is a problem. Compacting on every GC cycle will significantly increase pause times.

Additional garbage collection runtime options