![]() |
JavaTM HotSpot VM Options |
See also Performance Docs |
This document provides information on the command-line options and environment variables that can affect the performance characteristics of the Java HotSpot Virtual Machine. Unless otherwise noted, all information in this document pertains to both the Java HotSpot Client VM and the Java HotSpot Server VM.
The document contains the following sections.
Categories of Java HotSpot VM Options
Java HotSpot VM Equivalents of Exact VM Options
Java HotSpot Equivalents to _JIT_ARGS Environment Variables
Java HotSpot Equivalents to _JVM_ARGS Environment Variables
Additional Java HotSpot Arguments
Standard options recognized by the Java HotSpot VM are described on the Java Application Launcher reference pages for Win32, Solaris, and Linux. This document deals exclusively with non-standard options recognized by the Java HotSpot VM:
- Options that begin with -X are non-standard (not guaranteed to be supported on all VM implementations), and are subject to change without notice in subsequent releases of the Java 2 SDK.
- Because the -XX options have specific system requirements for correct operation and may require privileged access to system configuration parameters, they are not recommended for casual use. These options are also subject to change without notice.
Java HotSpot VM Equivalents of Exact VM Options
This section is of interest primarily to users of J2SE 1.3 and 1.4 on Solaris.Prior to version 1.3.0, the production releases of the Java 2 SDK for Solaris shipped with a virtual-machine implementation known as the Exact VM (EVM). Beginning with version 1.3.0, the Exact VM is replaced by the Java HotSpot VM.
Some options supported by the Exact VM have changed names or become obsolete in the Java HotSpot VM. These EVM options and their Java HotSpot VM equivalents are given in the following table.
EVM Option Description Java HotSpot equivalent -Xt Instruction tracing None (obsolete option) -Xtm Method tracing None (obsolete option) -Xoss Maximum java stack size None (HotSpot doesn't have separate native and Java stacks) -Xverifyheap Verify heap integrity -XX:+VerifyBeforeGC -XX:+VerifyAfterGC -XX:+VerifyTLE (-XX:+VerifyTLAB in J2SE 1.4) -XX:+VerifyBeforeScavenge -XX:+VerifyAfterScavenge (all debug only) -Xmaxjitcodesize Maximum Comiled code size -Xmaxjitcodesize (used to be -Xmaxjitcodesize=32m, now -Xmaxjitcodesize32m) -Xgenconfig Configure the heap (See section on Xgenconfig below) -Xoptimize Use optimizing JIT Compiler -server -Xconcgc Use concurrent garbage collector (1.2.2_07+) -XX:+UseConcMarkSweepGC (available beginning with J2SE 1.4.1) The Java HotSpot VM currently recognizes the following -X options that were not supported by the Exact VM.
Option Description -Xincgc Use Train GC -Xnoincgc Do not use Train Garbage Collection (default) -XX:MaxHeapFreeRatio=<Maximum> heap free percentage (default 70) -X:MinHeapFreeRation=<Minimum> heap free percentage (default 40) -Xint Intepreter only (no JIT Compilation) -XX:+UseBoundThreads Bind user level threads (Solaris only) -Xmn<Size> Set the size of the young generation (available beginning in J2SE 1.4.0) -XX:+UseParallelGC Use parallel garbage collection (available beginning in J2SE 1.4.1) -XX:+UseAltSigs On the Solaris operating environment, the VM uses SIGUSR1 by default, which can sometimes conflict with applications that signal-chain SIGUSR1. -XX:+UseAltSigs will cause the VM to use signals other than SIGUSR1 and SIGUSR2 as the default. Available beginning in J2SE 1.4.1 on the Solaris operating environment.
Java HotSpot VM Equivalents to _JIT_ARGS Environment Variables
Most _JIT_ARGS environment variables are internal debugging options only and have no corresponding Java HotSpot options. Most simply turn off some form of optimization which may have caused instability when first introduced and could be used by the internal testing group to track down problems.
_JIT_ARGS Environment HotSpot Option Description jit/jbe -client/-server jbe is the same as -Xoptimize in 1.2 based systems, jit is the default. Use -server in 1.3 to replace -Xoptimize (or jbe) in 1.2. trace -XX:+PrintCompilation traces methods as compiled V8/V9 -XX:+UseV8InstrsOnly Done autmatically on both systems, force architecture using these flags (Sparc/debug only)
_JVM_ARGS Environment HotSpot Option Description bound_threads -XX:+UseBoundThreads This option forces all threads to be created as bound threads. fixed_size_young_gen -XX:NewSize=<size>
-XX:MaxNewSize=<size> for 1.3
-Xmn<size> for 1.4Disable young generation resizing. To do this on HotSpot, simply set the size of the young generation to a constant. gc_stats -verbose:gc Turns on various forms of gc statistics gathering. ims_concurrent none inline_instrs -XX:MaxInlineSize=<size> Integer specifying maximum number of bytecode instructions in a method which gets inlined. -XX:FreqInlineSize=<size> Integer specifying maximum number of bytecode instructions in a frequently executed method which gets inlined. inline_print -XX:+PrintInlining Print message about inlined methods (debug only) no_parallel_gc none sync_final none yield_interval -XX:DontYieldALotInterval=<ms> (debug only) Interval in milliseconds between yields. monitor_order none
Additional Java HotSpot arguments
Numbers can include 'm' or 'M' for megabytes, 'k' or 'K' for kilobytes, and 'g' or 'G' for gigabytes (for example, 32k is the same as 32768). Turn on a boolean flag with -XX:+<option> and off with -XX:-<option>.
Flag and Default Description -XX:-AllowUserSignalHandlers Do not complain if the application installs signal handlers (Solaris Only) -XX:AltStackSize=16384 Alternate signal stack size (in Kbytes, Solaris Only) -XX:+MaxFDLimit Bump the number of file descriptors to max. (Solaris only) -XX:MaxHeapFreeRatio=70 Maximum percentage of heap free after GC to avoid shrinking -XX:MinHeapFreeRatio=40 Minimum percentage of heap free after GC to avoid expansion -XX:-UseBoundThreads Bind user level threads to kernel threads (Solaris only) -XX:-UseLWPSynchronization Use LWP-based instead of thread based synchronization. Default is on in J2SE 1.4.0 or higher. (Solaris only) -XX:+UseThreadPriorities Use native thread priorities -XX:MaxPermSize=64m Size of the Permanent Generation, see GC Tuning -XX:-CITime Time spent in JIT Compiler (1.4 only) -XX:-PrintTenuringDistribution Print tenuring age information -XX:TargetSurvivorRatio=50 Desired percentage of survivor space used after scavenge -XX:-DisableExplicitGC Disable calls to System.gc(), JVM still performs garbage collection when necessary Those flags differing per architecture/OS/JVM Verison. "Flag and Default" has the default of Sparc/-server, JVM version 1.3
Flag and Default Description -XX:CompileThreshold=10000 number of method invocations/branches before (re-)compiling [10,000 -server, 1,500 -client] -XX:MaxNewSize=32m Maximum size of new generation (in bytes) [32m sparc, 2.5m intel for 1.3, no limit for 1.4 as NewRatio is now used to determine MaxNewSize] -XX:NewRatio=2 Ratio of new/old generation sizes [sparc -server: 2, sparc -client: 4 (1.3) 8 (1.3.1+), intel: 12] -XX:NewSize=2228224 Default size of new generation (in bytes) [sparc 2.125M, intel: 640k] -XX:ReservedCodeCacheSize=32m Reserved code cache size (in bytes) - maximum code cache size. [Solaris 64-bit: 1024m] -XX:SurvivorRatio=64 Ratio of eden/survivor space size [Solaris: 64, Solaris: 32 (on 1.3.1 and later), Linux/Windows: 8] -XX:ThreadStackSize=512 Thread Stack Size (in Kbytes) (0 means use default stack size) [Sparc: 512, Solaris Intel: 256, Sparc 64bit: 1024 all others 0] -XX:+UseTLE
(-XX:+UseTLAB in J2SE 1.4)Use thread-local object allocation [Sparc -server: true, all others: false] -XX:-UseISM See Intimate Shared Memory -XX:-UseMPSS Use Multiple Page Size Support (Solaris 9 only) w/4mb pages for the heap. Do not use with ISM as this replaces the need for ISM.
Copyright © 2002 Sun Microsystems, Inc. All Rights Reserved. Please send comments to: mailto:j2se-comments@java.sun.com |
![]() |