6 Command-Line Options

This topic describes the various HotSpot command-line options and compares them with those available in Oracle JRockit:

Mapping of Oracle JRockit to HotSpot Command-Line Options

Certain Oracle JRockit command-line options are similar to HotSpot options.

This section provides either a one-to-one mapping of Oracle JRockit options to HotSpot options, or refers you to other sections of this document. There are certain Oracle JRockit options for which there are no corresponding HotSpot JVM options. Also, some of the mapped HotSpot options aren’t 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 options isn’t recommended. Especially for performance-related options, the best practice is to start by only specifying the Java heap size and the garbage collector, such as CMS or G1. Any additional tuning for HotSpot, if necessary, must be done based on new benchmarking and profiling done with HotSpot. It isn’t advised to assume that most, if any, JVM-level tuning decisions made for an Oracle JRockit configuration will also apply to a HotSpot configuration.

Table 6-1 -X Command-Line Options

Oracle JRockit HotSpot Notes

-Xbootclasspath

Same

NA

-Xbootclasspath/a

Same

NA

-Xbootclasspath/p

Same

NA

-Xcheck:jni

Same

NA

-Xdebug

Same

NA

-Xgc

NA

See Tuning Garbage Collection.

-XgcPrio (deprecated)

NA

See Garbage Collectors.

-XlargePages

-XX:+UseLargePages

NA

-Xmanagement

NA

NA

-Xms

Same

NA

-Xmx

Same

NA

-XnoClassGC (deprecated)

Same

Don’t use, except for troubleshooting.

-XnoOpt

NA

See Compilation Optimization.

-Xns

Same

NA

-XpauseTarget

-XX:MaxGCPauseMillis=n

See Garbage Collectors.

-Xrs

Same

NA

-Xss

Same

NA

-XstrictFP

NA

NA

-Xverbose

-verbose

See Logging.

-Xverbosedecorations

NA

See Logging.

-XverboseLog

NA

See Logging.

-XverboseTimeStamp

NA

See Logging.

Table 6-2 -XX Command-Line Options

Oracle JRockit HotSpot Notes 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 isn’t 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>

NA

-XX:+|-CheckJNICalls

-Xcheck:jni

NA

-XX:+|-CheckStacks

NA

NA

-XXcompaction

NA

NA

-XXcompactRatio (deprecated)

NA

NA

-XXcompactSetLimit (deprecated)

NA

NA

-XXcompactSetLimitPerObject (deprecated)

NA

NA

-XXcompressedRefs

-XX:-UseCompressedOops

See Runtime Options.

-XX:+|-CrashOnOutOfMemoryError

Same

NA

-XX:+|-DisableAttachMechanism

Same

NA

-XXdumpFullState

NA

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

-XXdumpSize

NA

NA

-XX:ExceptionTraceFilter

NA

NA

-XX:+|-ExitOnOutOfMemoryError

Same

NA

-XX:ExitOnOutOfMemoryErrorExitCode

NA

NA

-XXexternalCompactRatio (deprecated)

NA

NA

-XX:+|-FailOverToOldVerifier

Same

NA

-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

NA

-XX:+|-FlightRecordingDumpOnUnhandledException

NA

NA

-XX:FlightRecordingDumpPath

NA

NA

-XXfullSystemGC

Related options:

  • -XX:+DisableExplicitGC

  • -XX:+ExplicitGCInvokesConcurrent

  • -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses

See Garbage Collectors.

-XXgcThreads

Related options:

  • -XX:ParallelGCThreads=<threads>

  • -XX:ConcGCThreads=<threads>

See Garbage Collectors.

-XX:GCTimePercentage

NA

NA

-XX:GCTimeRatio

NA

NA

-XXgcTrigger

Related options:

  • -XX:CMSInitiatingOccupancyFraction=<percent>

  • -XX:CMSTriggerRatio=<percent>

See Garbage Collectors.

-XX:+|-HeapDiagnosticsOnOutOfMemoryError

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

Example:

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

-XX:HeapDiagnosticsPath

NA

NA

-XX:+|-HeapDumpOnCtrlBreak

NA

NA

-XX:+|-HeapDumpOnOutOfMemoryError

Same

NA

-XX:HeapDumpPath

Same

NA

-XX:HeapDumpSegmentSize

NA

NA

-XXheapParts (deprecated)

NA

NA

-XXinternalCompactRatio (deprecated)

NA

NA

-XX:+|-JavaDebug

NA

NA

-XXkeepAreaRatio

XX:SurvivorRatio=<ratio>

Sets the ratio between the eden space size and the 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 the survivor space is resized according to the application behavior, starting with this initial value.

-XXlargeObjectLimit (deprecated)

NA

NA

-XX:MaxCodeMemory

-XX:ReservedCodeCacheSize=<size>

See Compilation Optimization.

-XX:MaxDirectMemorySize

Same

NA

-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 Runtime options.

-XX:MaxRecvBufferSize

NA

NA

-XXminBlockSize (deprecated)

NA

NA

-XXnoSystemGC

Related options:

  • -XX:+DisableExplicitGC

  • -XX:+ExplicitGCInvokesConcurrent

  • -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses

See Garbage Collectors.

-XX:OptThreads

-XX:CICompilerCount=threads

See Compilation Optimization.

-XX:+|-RedoAllocPrefetch

Related options:

  • -XX:AllocateInstancePrefetchLines=<lines>

  • -XX:AllocatePrefetchDistance=<size>

  • -XX:AllocatePrefetchInstr=<instruction>

  • -XX:AllocatePrefetchLines=<lines>

  • -XX:AllocatePrefetchStepSize=<size>

  • -XX:AllocatePrefetchStyle=<style>

NA

-XX:+|-ReserveCodeMemory

-XX:ReservedCodeCacheSize=<size>

See Compilation Optimization.

-XX:SegmentedHeapDumpThreshold

NA

NA

-XXsetGC (deprecated)

NA

NA

-XX:+|-StrictFP

NA

NA

-XX:StartFlightRecording

Same

NA

-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

NA

NA

-XX:+|-UseAdaptiveFatSpin

NA

NA

-XX:+|-UseAllocPrefetch

Related options:

  • -XX:AllocateInstancePrefetchLines=<lines>

  • -XX:AllocatePrefetchDistance=<size>

  • -XX:AllocatePrefetchInstr=<instruction>

  • -XX:AllocatePrefetchLines=<lines>

  • -XX:AllocatePrefetchStepSize=<size>

  • -XX:AllocatePrefetchStyle=<style

NA

-XX:+|-UseCallProfiling

-XX:+UseTypeProfile

NA

-XX:+|-UseCfsAdaptedYield

NA

NA

-XX:+|-UseClassGC

-Xnoclassgc

Disables garbage collection (GC) of classes. This can save the 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 active.

-XX:+|-UseCPoolGC

NA

NA

-XX:+|-UseFastTime

NA

NA

-XX:+|-UseFatSpin

NA

NA

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

  • -XX:+UseLargePages

  • -XX:+UseLargePagesInMetaspace

See Runtime Options.

-XX:+|-UseLazyUnlocking

-XX:+UseBiasedLocking

See Runtime Options.

-XX:+|-UseLockProfiling

NA

NA

-XX:+|-UseLowAddressForHeap

NA

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 JDK 5. This option must not be used on JDK 6 or later versions.

-XX:+|-UseThreadPriorities

Same

On HotSpot, this option is enabled by default for the Windows platform. On JRockit, this option is disabled by default for the Windows platform.

Table 6-3 Diagnostic Commands

Oracle JRockit HotSpot

check_flightrecording

JFR.check

command_line

VM.command_line

dump_flightrecording

JFR.dump

exception_trace_filter

NA

force_crash

NA

heap_diagnostics

GC.heap_info

help

help

hprofdump

GC.heap_dump

kill_management_server

ManagementAgent.stop

list_vmflags

VM.flags

lockprofile_print

NA

lockprofile_reset

NA

memleakserver

NA

print_class_summary

GC.class_stats

print_exceptions

NA

print_memusage

VM.native_memory

print_object_summary

GC.class_histogram

print_threads

Thread.print

print_utf8pool

VM.stringtable and VM.symboltable

print_vm_state

VM.info

runsystemgc

GC.run

set_filename

NA

start_flightrecording

JFR.start

start_management_server

ManagementAgent.start

ManagementAgent.start_local

stop_flightrecording

JFR.stop

stop_management_server

ManagementAgent.stop

timestamp

NA

verbosity

NA

version

VM.version

jcmd Commands

The following are the list of jcmd commands:

  • JFR.configure

  • JFR.stop

  • JFR.start

  • JFR.dump

  • JFR.check

  • VM.log

  • VM.native_memory

  • VM.check_commercial_features

  • VM.unlock_commercial_features

  • ManagementAgent.status

  • ManagementAgent.stop

  • ManagementAgent.start_local

  • ManagementAgent.start

  • Compiler.directives_clear

  • Compiler.directives_remove

  • Compiler.directives_add

  • Compiler.directives_print

  • VM.print_touched_methods

  • Compiler.codecache

  • Compiler.codelist

  • Compiler.queue

  • VM.classloader_stats

  • Thread.print

  • JVMTI.data_dump

  • JVMTI.agent_load

  • VM.stringtable

  • VM.symboltable

  • VM.class_hierarchy

  • GC.class_stats

  • GC.class_histogram

  • GC.heap_dump

  • GC.finalizer_info

  • GC.heap_info

  • GC.run_finalization

  • GC.run

  • VM.info

  • VM.uptime

  • VM.dynlibs

  • VM.set_flag

  • VM.flags

  • VM.system_properties

  • VM.command_line

  • VM.version help

For the complete list of commands, see jcmd Commands in the Java Platform, Standard Edition Tools Reference guide.