views:

1046

answers:

1

This question is probably better phrased: how does running a Java server on a hypervisor such as VMware ESX affect the Java heap?

  • Access to JVM heap is random from the OS/hypervisor perspective
  • It is difficult to for guest OS or hypervisor to optimize memory that is randomly accessed
  • Given this, can the hypervisor detect unused pages in JVM heap?

The conventional wisdom for Java server applications is that performance is best if you allocate all the heap at JVM startup, rather than allowing the heap to be dynamically resized as the need arises. In other words, if you set the heap size to 1GB, your Java process will grab 1GB of contiguous virtual address space (+ whatever is needed for the binaries), memory which is no longer available to other applications.

Is VMware smart enough to detect that some of this heap is in fact unused? How does this affect GC performance? Would it be better to let the heap be dynamically resized in VMware? What GC strategies work best with VMware guests?

Also, if anyone can point me towards guidelines for tuning JVM heaps in virtualized environments, I would be most appreciative.

+3  A: 

Related to my question:

Here is a PDF that provides a broad overview of considerations for running Java on VMware guests: link text

Rob