You are on page 1of 1

For m ore

awesom
JVM Options cheat sheet vis it rebe e cheat s heets
ll abs.org!

Standard Options Non-Standard Options Advanced Options


$ java $ java -X BEHAVIOR PERFORMANCE
List all standard options. List all non-standard options.
-XX:+UseConcMarkSweepGC -XX:MaxPermSize=128m (Java 7 or earlier)
-Dblog=RebelLabs -Xint Enables CMS garbage collection. Sets the max perm space size (in bytes).
Sets a blog system property to RebelLabs. Runs the application in interpreted-only
Retrieve/set it during runtime like this: mode. -XX:+UseParallelGC -XX:ThreadStackSize=256k
Enables parallel garbage collection. Sets Thread Stack Size (in bytes).
System.getProperty("blog"); -Xbootclasspath:path (Same as -Xss256k)
//RebelLabs Path and archive list of boot class files. -XX:+UseSerialGC
Enables serial garbage collection. -XX:+UseStringCache
System.setProperty("blog", "RL"); -Xloggc:filename Enables caching of commonly
Log verbose GC events to filename. -XX:+UseG1GC allocated strings.
-javaagent:/path/to/agent.jar Enables G1GC garbage collection.
Loads the java agent in agent.jar. -Xms1g -XX:G1HeapRegionSize=4m
Set the initial size (in bytes) of the heap. -XX:+FlightRecorder (requires Sets the sub-division size of G1 heap
-agentpath:pathname -XX:+UnlockCommercialFeatures) (in bytes).
Loads the native agent library specified by -Xmx8g Enables the use of the Java Flight Recorder.
the absolute path name. Specifies the max size (in bytes) of the heap. -XX:MaxGCPauseMillis=n
Sets a target for the maximum GC
-verbose:[class/gc/jni] -Xnoclassgc DEBUGGING pause time.
Displays information about each loaded Disables class garbage collection. -XX:ErrorFile=file.log
class/gc event/JNI activity. -XX:MaxNewSize=256m
Save the error data to file.log.
-Xprof Max size of new generation (in bytes).
Profiles the running program. -XX:+HeapDumpOnOutOfMemory
XX:+AggressiveOpts
Enables heap dump when
Enables the use of aggressive performance
OutOfMemoryError is thrown.
optimization features.

-XX:+PrintGC
-XX:OnError="<cmd args>
Enables printing messages during
Run user-defined commands
garbage collection.
on fatal error.

-XX:+TraceClassLoading
Enables Trace loading of classes.

-XX:+PrintClassHistogram
Enables printing of a class instance histogram
after a Control+C event (SIGTERM).

You might also like