Unusual JVM options

How many JVM options did you use ever? If you run "java" without arguments, it will show you a couple of dozens of command line options. But even some very popular options, like -Xmx are not listed there. Let me introduce you to a magic command which can surprise you. Run this ...

$ java -XX:+AggressiveOpts -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+PrintFlagsFinal

... and you will see about 800 options, most of which you probably never heard about. I found this command, trying to control the behaviour of "java.lang.OutOfMemoryError: GC overhead limit exceeded" exception. Oracle documentation states, that it is thrown when GC takes 98% of time and frees only 2% of memory. I wanted to kill the process earlier, and to use -XX:+HeapDumpOnOutOfMemoryError to investigate the situation. So the full list revealed GCTimeLimit and GCHeapFreeLimit, for example.

I also found the following blog post with some descriptions of exotic options: http://stas-blogspot.blogspot.co.il/2011/07/most-complete-list-of-xx-options-for.html. Of course, it is still a good idea to check what your JVM supports, using the command that I have shown earlier.

Thank you for your interest!

We will contact you as soon as possible.

Send us a message

Oops, something went wrong
Please try again or contact us by email at info@tikalk.com