tags:

views:

165

answers:

2

Our production environment runs 3 32-Bit Java 6 JVMs on each Windows 2003 server. Each heap is at it's max setting (~1.25GB). We are considering moving to new servers and using 64-Bit JVMs. Presumably we can then have one 64-bit JVM on each server that would replace the 3 32-Bit JVMs on each server because of the allowance for a much larger heap size when using a 64-bit JVM.

Anyone done this and have any lessons learned?

I am specifically concerned with any performance considerations and what to do to compensate.

A: 

I've not done this, but this should be perfectly fine as long as you aren't relying on any 32-bit JNI code for which you do not have 64-bit versions. If all you are using is pure Java, there should be no problems.

Michael Aaron Safyan
+1  A: 

The memory requirements will go up as it is more expensive to address objects on a 64 bit architecture. How much is really depending on your application. A wild guess would be 10%-20%, assuming that you are not hashing 4 gb of Integers...

You may also get problems with lock contention on locks in loggers, thread pools, connection pools, singletons etc. It is probably not a problem if your application is database centric, but if - for example- Your application is storing a lot of sessions in a map, and access that map a lot, you might get problems. The contention "wall" can come rather quickly, in my experience.

However, there is only one way to know : ...test it.

KarlP
+1, try it and see. Also, as of Java 6 update 14, you can enable compressed object pointers for heap sizes <32GB with "-XX:+UseCompressedOops", which should remove the slight memory increase due to 64-bit object pointers while giving you the benefits of a 64-bit JVM.
Joshua McKinnon