tech oriented notes to self and lessons learned
Some of the more frequently used Java HotSpot VM Options have been publicly documented by Oracle.
Of those flags the following are the ones I tend to find most useful for server-side Java applications:
Occasionally, the following might also be helpful to gain more insight into what the GC is doing:
Oracle documentation covers quite a few HotSpot VM flags, but every once in a while you bump into flags that aren’t on the list. So, you begin to wonder if there’re more JVM options out there.
And, in fact, there’s a lot more as documented by this blog entry: The most complete list of -XX options for Java JVM
That list is enough to make any JVM application developer stand in awe 🙂
There’s enough options to shoot yourself in the foot, but you should avoid the temptation of employing each and every option.
Most of the time it’s best to use only the one’s you know are needed. JVM options and their default values tend to change from release to release, so it’s easy to end up with a huge list of flags that suddenly may not be required at all with a new JVM release, or worse, may even result in conflicting or erroneous behavior. The implications of some of the options, the GC one’s in particular, and the way that related options interact with each other may sometimes be difficult. Using a minimal list of options is easier to understand and maintain. Don’t just copy-paste options from other applications without really understanding what they’re for.
So, what’re your favorite options?
Mine would probably be -XX:SelfDestructTimer 😉
(No, there really is such an option and it does work)