Friday, August 27, 2010

Java Command-line flags for the JVM

DisableExplicitGC

-XX:+DisableExplicitGC flag automatically turns a System.gc() call into a no-op

HeapDumpOnOutOfMemoryError

 -XX:+HeapDumpOnOutOfMemory

Setting this command tells the JVM to take a "heap dump snapshot" and save it to a file for processing.
You can specify the actual path to which the file is saved using the corresponding -XX:HeapDumpPath flag.

java -X lists all the non-standard (but mostly safe) arguments that the JVM provides — things like:

    * -Xint, which runs the JVM in interpreted mode (which can be useful for testing whether the JIT compiler is actually having an effect on your code or verifying if you have a bug in the JIT compiler).
    * -Xloggc:, which does the same thing as -verbose:gc but logs to a file instead of spe
    
Source
http://www.ibm.com/developerworks/java/library/j-5things11/index.html

Java,Java Command Line Flags

No comments: