Examples
-server -Xms1024m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=512m -XX:+PrintGCDetails -Xloggc:/logs/gc.$$.log
Means that start in Server mode, the initial heap 1024m, 1024m maximum heap, the new generation of initial 256m, the largest new generation of 512m, print verbose GC logs, and output to gc. $$. Log.
Common virtual machine parameters
- Linux/ARM (32-bit): 320 KB
- Linux/i386 (32-bit): 320 KB
- Linux/x64 (64-bit): 1024 KB
- OS X (64-bit): 1024 KB
- Solaris/i386 (32-bit): 320 KB
- Oracle Solaris/x64 (64-bit): 1024 KB
-XX: ErrorFile = filename
Specifies the path to the error log occurs when an unrecoverable error.
-XX: MaxDirectMemorySize = size
maximum buffer allocation of NIO provided directly.
-XX: + HeapDumpOnOutOfMemory
when an OutOfMemoryError occurs, generate a dump file. You can use -XX: HeapDumpPath specify the path and name of the heap dump file.
-XX: LogFile = path
setting data written to the log path and file name.
-XX: NewRatio = ratio
proportion of the young generation and the old age.
-XX: + PrintGC
print a message when GC.
-XX: + PrintGCDetails
print detailed message the GC.
-XX: + UseConcMarkSweepGC
enable CMS garbage collector for the old era.
-XX: + UseG1GC
enabled G1 collector.
-XX: + UseParallelGC
enable parallel scanning garbage collector
-XX: + UseParallelOldGC
enable parallel scanning of old garbage collector's
-XX: + UseParNewGC
enable the new generation of parallel scanning garbage collector