IBM JVM option
Disclaimer: Please note that the data presented in this document has been gathered from several publicly available sources. It is a conscious selection of available VM parameters and even though we tried to check most of the facts presented this document may contain errors. Also note that the semantics of some of these parameters are different when used with IBM's resettable JVM for the z/OS platform.
Printing Information about GC
Prints out information about garbage collections to standard out.
See -Xverbosegclog
Supported by: 1.3.1, 1.4.1, 1.4.2
-Xverbosegclog:<path to file><filename[,X,Y]>
Prints out information about garbage collections to a file. If the integers X and Y are specified, the output is redirected to X files each containing output from Y GC cycles.
See -verbose:gc
Supported by: 1.4.1, 1.4.2
Sizing Heap and Generations
Overall maximum heap size. You may use k, m and g for kilobyte, megabyte and gigabyte.
Example:
-Xmx256m sets the maximum heap size to 256mb
Supported by: 1.3.1, 1.4.1, 1.4.2
Overall minimum heap size. You may use k, m and g for kilobyte, megabyte and gigabyte.
Example:
-Xmx256m sets the minimum heap size to 256mb
Supported by: 1.3.1, 1.4.1, 1.4.2
Sets the initial size of the system heap. Classes in this heap exist for the lifetime of the JVM. The system heap is never subjected to garbage collection. The maximum size of the system heap is unbounded. You may use k, m and g for kilobyte, megabyte and gigabyte.
Example:
-Xinitsh256m sets the minimum system heap size to 256mb
Supported by: 1.3.1, 1.4.1, 1.4.2
This is a floating point number between 0 and 1, which specifies the maximum percentage of free space in the heap. The default is 0.6, or 60%. When this value is set to 0, heap contraction is a constant activity. With a value of 1, the heap never contracts. You may use k, m and g for kilobyte, megabyte and gigabyte.
Example:
-Xmaxf0.6 specifies that the heap will be contracted if more
then 60% of the heap are unused.
Supported by: 1.3.1, 1.4.1, 1.4.2
This is a floating point number between 0 and 1, which specifies the minimum percentage of free space in the heap. The default is 0.3, or 30%. The heap grows if the free space is below the specified amount. You may use k, m and g for kilobyte, megabyte and gigabyte.
Example:
-Xminf0.3 specifies that the heap will be grown if less
then 30% of the heap are unused.
Supported by: 1.3.1, 1.4.1, 1.4.2
Choosing and Configuring a Collector
-Xgcpolicy:<optthruput|optavgpause|subpool>
Note that the subpool option was introduced in Version 1.4.1 Service Refresh 1 for AIX only.
Setting gcpolicy to optthruput disables concurrent mark. If you do not have pause time problems (as seen by erratic application response times or by analysis of the verbose GC output), you should get the best throughput with this option. optthruput is the default setting.
Setting gcpolicy to optavgpause enables concurrent mark with its default values. If you are having problems with erratic application response times that are caused by normal garbage collections, you can remove those problems at the cost of some throughput when running with the optavgpause option.
Setting gcpolicy to subpool enables improved object allocation that aims to achieve better performance in allocating objects on the heap. This setting might provide additional throughput optimization because it can improve the efficiency of object allocation and reduce lock contention on large SMP systems. Concurrent mark is disabled when this policy is enabled.
Supported by: 1.3.1, 1.4.1, 1.4.2
Sets the total number of threads that are used for garbage collection. On a system with n processors, the default setting is n.
Supported by: 1.3.1, 1.4.1, 1.4.2
Compacts the heap every garbage collection cycle. The default is false (that is, the heap is not compacted). This is not recommended.
Supported by: 1.3.1, 1.4.1, 1.4.2
Never compact the heap. Default is false.
Supported by: 1.3.1, 1.4.1, 1.4.2
Disables class garbage collection.
Supported by: 1.3.1, 1.4.1, 1.4.2
Miscellaneous Settings
Sets maximum native stack size for any thread.
You may use k, m and g for kilobyte, megabyte and gigabyte.
Example:
-Xss128k sets the stack size to 128kb
Supported by: 1.3.1, 1.4.1, 1.4.2
Sets maximum Java stack size for any thread.
You may use k, m and g for kilobyte, megabyte and gigabyte.
Example:
-Xoss128k sets the stack size to 128kb
Supported by: 1.3.1, 1.4.1, 1.4.2
Runs full compaction each time java.lang.System.gc() is called. Its default behavior with a java.lang.System.gc() call is to perform a compaction only if an allocation failure triggered a garbage collection since the last java.lang.System.gc() call.
Supported by: 1.4.1, 1.4.2
Never runs compaction when java.lang.System.gc() is called. Its default behavior with a java.lang.System.gc() call is to perform a compaction only if an allocation failure triggered a garbage collection since the last java.lang.System.gc() call.
Supported by: 1.4.1, 1.4.2
Converts Java application calls to java.lang.System.gc() into no-ops.
Supported by: 1.4.1, 1.4.2