32-bit versus 64-bit JVM performance considerations?
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开发者_JAVA技巧 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.
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.
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.
精彩评论