Search the VMware Knowledge Base (KB)
View by Article ID

Best practices for running Java in a virtual machine (1008480)

  • 22 Ratings


This article provides best practices for installing and running Java on a virtual machine.


These points are general recommendations:

  • Size the virtual machine memory to leave adequate space for the Java heap, the other memory demands of the Java virtual machine code and stack, and any other concurrently executing process that needs memory from the guest operating system.

  • Set the memory reservation value in the VMware Infrastructure Client to the size of memory for the virtual machine. As any type of Memory Swapping  (physical or virtual) is detrimental to performance of JVM heap especially for Garbage Collection.

  • Determine the optimal number of virtual CPUs for a virtual machine that hosts a Java application by testing the virtual machine configured with different numbers of virtual CPUs at different times with the same load.

  • If you are using multiple Garbage Collector threads in your JVM, match the number of those threads to the number of virtual CPUs that are configured in the virtual machine.

  • For easier monitoring and load balancing, use one JVM process per virtual machine.

  • If your ESX host is overcommitted, ensure that the Balloon Driver is running within the virtual machine so that memory is optimally managed.

Additional Information

For more information, see the VMware Technical Paper Enterprise Java Applications on VMware - Best Practices Guide undefined undefined.

See Also

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.


  • 22 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.

What can we do to improve this information? (4000 or fewer characters)

Please enter the Captcha code before clicking Submit.
  • 22 Ratings