We earn commission when you buy through affiliate links.

This does not influence our reviews or recommendations.Learn more.

Get to know essential JVM (Java Virtual Machine) options for better performance and debugging.

Article image

Lets find out them.

If you try an advanced option, you always use the option with-XX.

Similarly, if youre applying a non-standard option, you use-X.

Standard options dont prepend anything to the option.

Which JVM options are used by your software?

So, when a JVM starts, the heap memory will be this much big.

This is carried to prevent resizing during startup and enhance the startup time of JVM.

You will essentially always have-Xmsand-Xmxtogether.

Enable class data sharing

SpecifyXshareclassesoption to enable class data sharing in a shared class cache.

The JVM connects to an existing cache or creates a cache if one does not exist.

There is no expense involved unless an OOM really occurs.

The heap dump will be set up in the current directory of the JVM by default.

Java classpath

Talking about JAVA Classpath then-Xbootclasspathspecifies classpath entries we want loaded without verification.

In JRuby, this reduced startup time by half and more for a simple script.

And obviously, the OS bit can be either 32 or 64.

Conclusion

I hope this helps you to configure JVM parameters for your software.

If you are interested in learning in-depth about java memory management, then check out thisUdemy course.