6 Command Line Options

This chapter describes various HotSpot command line options and compares them with those available in Oracle JRockit.

Note:

Some of the tools described in this document require a commercial license for use in production. To learn more about commercial features and how to enable them, see http://www.oracle.com/technetwork/java/javaseproducts/.

Mapping of Oracle JRockit to HotSpot Command Line Options

This section can be used as a reference by users who are searching for functionality similar to a specific Oracle JRockit flag they may be familiar with. This section seeks to provide either a one-to-one mapping of Oracle JRockit options to HotSpot options, or refers to the other sections of this document. There may be certain Oracle JRockit options for which there are no corresponding HotSpot JVM options. Some of the mapped HotSpot options may not be exactly equivalent to the Oracle JRockit options and may provide slightly different behavior on the HotSpot.

When migrating, simply translating every option used with Oracle JRockit into similar HotSpot option is not recommended. Especially for performance-related options, the best practice is to start by only specifying the Java heap size and the garbage collector (CMS, G1, and so on). Any additional tuning for HotSpot, if necessary at all, should only be done based off of new benchmarking and profiling done with HotSpot. It is not advised to assume that most, if any, JVM-level tuning decisions made for an Oracle JRockit configuration will also apply as-is to a HotSpot configuration.

See Oracle JRockit Documentation for more information.

Table 6-1 -X Command-Line Options

Oracle JRockit HotSpot Added In Note

-Xbootclasspath

SAME

   

-Xbootclasspath/a

SAME

   

-Xbootclasspath/p

SAME

   

-Xcheck:jni

SAME

   

-Xdebug

SAME

   

-Xgc

--

 

See section on GC for more details.

-XgcPrio (deprecated)

--

 

See section on GC for more details.

-XlargePages

-XX:+UseLargePages

5u5

See https://blogs.oracle.com/poonam/entry/uselargepages_on_linux

-Xmanagement

--

 

See http://docs.oracle.com/javase/7/docs/technotes/guides/management/agent.html

-Xms

SAME

   

-Xmx

SAME

   

-XnoClassGC (deprecated)

SAME

 

Should not use except for troubleshooting.

-XnoOpt

--

 

See section on Compilation Optimization for more details.

-Xns

SAME

   

-XpauseTarget

-XX:MaxGCPauseMillis=n

 

See section on GC for more details.

-Xrs

SAME

   

-Xss

SAME

   

-XstrictFP

--

   

-Xverbose

-verbose

 

See section on Logging.

-Xverbosedecorations

--

 

See section on Logging.

-XverboseLog

--

 

See section on Logging.

-XverboseTimeStamp

--

 

See section on Logging.

-Xverify

SAME

   

Table 6-2 -XX Command-Line Options

Oracle JRockit HotSpot Note On HotSpot Options

-XXaggressive

-XX:+AggressiveHeap

-XX:+AggressiveOpts

-XX:+AggressiveHeap enables Java heap optimization. This sets various parameters to be optimal for long-running jobs with intensive memory allocation, based on the configuration of the computer (RAM and CPU). By default, the option is disabled and the heap is not optimized.

-XX:+AggressiveOpts enables other non-heap related optimization.

-XX:AllocChunkSize

Related options:

  • -XX:AllocateInstancePrefetchLines=<lines>

  • -XX:AllocatePrefetchDistance=<size>

  • -XX:AllocatePrefetchInstr=<instruction>

  • -XX:AllocatePrefetchLines=<lines>

  • -XX:AllocatePrefetchStepSize=<size>

  • -XX:AllocatePrefetchStyle=<style>

 

-XX:+|-CheckJNICalls

-Xcheck:jni

 

-XX:+|-CheckStacks

--

 

-XXcompaction

--

 

-XXcompactRatio (deprecated)

--

 

-XXcompactSetLimit (deprecated)

--

 

-XXcompactSetLimitPerObject (deprecated)

--

 

-XXcompressedRefs

-XX:-UseCompressedOops

See section on Runtime options for more details.

-XX:+|-CrashOnOutOfMemoryError

Can achieve the same by using -XX:OnOutOfMemoryError=<command>

Sets a custom command or a series of semicolon-separated commands to run when an OutOfMemoryError exception is first thrown.

For example:

java -XX:OnOutOfMemoryError="kill -11 %p" JavaProgram

-XX:+|-DisableAttachMechanism

SAME

 

-XXdumpFullState

--

On HotSpot side, there is an option CreateMinidumpOnCrash to enable the dumping of minidumps upon fatal errors on Windows platform.

-XXdumpSize

--

 

-XX:ExceptionTraceFilter

--

 

-XX:+|-ExitOnOutOfMemoryError

Can achieve the same by using -XX:OnOutOfMemoryError=<command>

Sets a custom command or a series of semicolon-separated commands to run when an OutOfMemoryError exception is first thrown.

For example:

java -XX:OnOutOfMemoryError="kill -9 %p" JavaProgram

-XX:ExitOnOutOfMemoryErrorExitCode

--

 

-XXexternalCompactRatio (deprecated)

--

 

-XX:+|-FailOverToOldVerifier

SAME

 

-XX:+|-FlightRecorder

SAME

Enables the use of the Java Flight Recorder (JFR) during the runtime of the application. This is a commercial feature that requires you to also specify the -XX:+UnlockCommercialFeatures option.

-XX:FlightRecorderOptions

SAME

 

-XX:+|-FlightRecordingDumpOnUnhandledException

--

 

-XX:FlightRecordingDumpPath

--

 

-XXfullSystemGC

Related options:

  • -XX:+DisableExplicitGC

  • -XX:+ExplicitGCInvokesConcurrent

  • -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses

See GC section for more details.

-XXgcThreads

Related options:

  • -XX:ParallelGCThreads=<threads>

  • -XX:ConcGCThreads=<threads>

See GC section for more details.

-XX:GCTimePercentage

--

 

-XX:GCTimeRatio

--

 

-XXgcTrigger

Related options:

  • -XX:CMSInitiatingOccupancyFraction=<percent>

  • -XX:CMSTriggerRatio=<percent>

See section on GC for more details.

-XX:+|-HeapDiagnosticsOnOutOfMemoryError

Can achieve the same by using -XX:OnOutOfMemoryError=<command>

Example:

java -XX:OnOutOfMemoryError="jmap -heap %p" JavaProgram

-XX:HeapDiagnosticsPath

--

 

-XX:+|-HeapDumpOnCtrlBreak

--

 

-XX:+|-HeapDumpOnOutOfMemoryError

SAME

 

-XX:HeapDumpPath

SAME

 

-XX:HeapDumpSegmentSize

--

 

-XXheapParts (deprecated)

--

 

-XXinternalCompactRatio (deprecated)

--

 

-XX:+|-JavaDebug

--

 

-XXkeepAreaRatio

XX:SurvivorRatio=<ratio>

Sets the ratio between eden space size and survivor space size. By default, this option is set to 8.

There is another option -XX:InitialSurvivorRatio=ratio to set the initial survivor space ratio used by the throughput garbage collector.. Adaptive sizing is enabled by default with the throughput garbage collector by using the -XX:+UseParallelGC and -XX:+UseParallelOldGC options, and survivor space is resized according to the application behavior, starting with this initial value.

-XXlargeObjectLimit (deprecated)

--

 

-XX:MaxCodeMemory

-XX:ReservedCodeCacheSize=<size>

See section on Compilation/Optimization for more details.

-XX:MaxDirectMemorySize

SAME

 

-XX:MaximumNurseryPercentage

-XX:NewRatio=<ratio>

Sets the ratio between young and old generation sizes. By default, this option is set to 2.

-XX:MaxLargePageSize

-XX:LargePageSizeInBytes=<size>

See section on Runtime options for more details.

-XX:MaxRecvBufferSize

--

 

-XXminBlockSize (deprecated)

--

 

-XXnoSystemGC

Related options:

  • -XX:+DisableExplicitGC

  • -XX:+ExplicitGCInvokesConcurrent

  • -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses

See GC section for details.

-XX:OptThreads

-XX:CICompilerCount=threads

See section on Compilation/Optimization for more details.

-XX:+|-RedoAllocPrefetch

Related options:

  • -XX:AllocateInstancePrefetchLines=<lines>

  • -XX:AllocatePrefetchDistance=<size>

  • -XX:AllocatePrefetchInstr=<instruction>

  • -XX:AllocatePrefetchLines=<lines>

  • -XX:AllocatePrefetchStepSize=<size>

  • -XX:AllocatePrefetchStyle=<style>

 

-XX:+|-ReserveCodeMemory

-XX:ReservedCodeCacheSize=<size>

See section on Compilation/Optimization for more details.

-XX:SegmentedHeapDumpThreshold

--

 

-XXsetGC (deprecated)

--

 

-XX:+|-StrictFP

--

 

-XX:StartFlightRecording

SAME

 

-XXtlaSize

XX:TLABSize=<size>

Sets the initial size (in bytes) of a thread-local allocation buffer (TLAB). If this option is set to 0, then the JVM chooses the initial size automatically.

-XX:TreeMapNodeSize

--

 

-XX:+|-UseAdaptiveFatSpin

--

 

-XX:+|-UseAllocPrefetch

Related options:

  • -XX:AllocateInstancePrefetchLines=<lines>

  • -XX:AllocatePrefetchDistance=<size>

  • -XX:AllocatePrefetchInstr=<instruction>

  • -XX:AllocatePrefetchLines=<lines>

  • -XX:AllocatePrefetchStepSize=<size>

  • -XX:AllocatePrefetchStyle=<style

 

-XX:+|-UseCallProfiling

-XX:+UseTypeProfile

 

-XX:+|-UseCfsAdaptedYield

--

 

-XX:+|-UseClassGC

-Xnoclassgc

Disables garbage collection (GC) of classes. This can save some GC time, which shortens interruptions during the application run.

When you specify Xnoclassgc at startup, the class objects in the application will be left untouched during GC and will always be considered live.

-XX:+|-UseCPoolGC

--

 

-XX:+|-UseFastTime

--

 

-XX:+|-UseFatSpin

--

 

-XX:+|-UseLargePagesFor[Heap|Code]

  • -XX:+UseLargePages

  • -XX:+UseLargePagesInMetaspace

See section on Runtime options for more details.

-XX:+|-UseLazyUnlocking

-XX:+UseBiasedLocking

See section on Runtime options for more details.

-XX:+|-UseLockProfiling

--

 

-XX:+|-UseLowAddressForHeap

--

No direct corresponding option available in HotSpot but the low heap base can be specified explicitly using HeapBaseMinAddress option.

-XX:+|-UseNewHashFunction

SAME

Only relevant for JDK5. Should not be used on JDK 6 or higher.

-XX:+|-UseThreadPriorities

SAME

On HS, enabled by default for Windows. On JR, disabled by default for Windows.


Table 6-3 Diagnostic Commands

Oracle JRockit HotSpot

check_flightrecording

JFR.check

command_line

VM.command_line

dump_flightrecording

JFR.dump

exception_trace_filter

--

force_crash

--

heap_diagnostics

--

help

help

hprofdump

GC.heap_dump

kill_management_server

ManagementAgent.stop

list_vmflags

VM.flags

lockprofile_print

--

lockprofile_reset

--

memleakserver

--

print_class_summary

GC.class_stats

print_exceptions

--

print_memusage

VM.native_memory

print_object_summary

GC.class_histogram

print_threads

Thread.print

print_utf8pool

--

print_vm_state

--

runsystemgc

GC.run

set_filename

--

start_flightrecording

JFR.start

start_management_server

ManagementAgent.start

ManagementAgent.start_local

stop_flightrecording

JFR.stop

stop_management_server

ManagementAgent.stop

timestamp

--

verbosity

--

version

VM.version