Our company is planning to move to 64 bit JVM in order to get away from 2 GB maximum heap size limit. Google gave me very mixed results about 64 bit JVM performance. Has anyone tried moving to 64 bit java and share your experience
The 64-bit JVM allows heaps >> 4 GB and, as such, only makes sense for applications which can take advantage of huge memory on systems which have it. Generally there is either a slight improvement (due to certain hardware optimizations on certain platforms) or minor degradation (due to increased pointer size).
64 bit Java will often perform better on things with heavy computation loads. Java programs, classically, have heavy I/O loads and heavy network loads; 64 bit vs 32 bit may not matter, but operating systems usually do.
In 32-bit JVM we can have less memory for heap size than in 64-bit JVM. In 64-bit JVM we can specify more memory for heap size than in 32-bit JVM. The limit for maximum memory in 32-bit is useful for 4G connectivity. It is particularly useful for java applications with large heaps.
In a nutshell: 64-bit JVMs will consume more memory for object references and a few other types (generally not significant), consume more memory per thread (often significant on high-volume sites) and enable you to have larger heaps (generally only important if you have many long-lived objects)
Longer Answers/Comments:
The comment that Java is 32-bit by design is misleading. Java memory-addressing is either 32, or 64-bit, but the VM spec ensures that most fields (e.g. int, long, double, etc.) are the same regardless.
Also - the GC tuning comments while pertinent for number of objects, may not be relevant, GC can be quick on JVMs with large heaps (I've worked with heaps up to 15GB, with very quick GC) - it depends more on how you play with the generational collector schemes, and what your object usage pattern is. While in the past people have spent lots of energy tuning parameters, it's very workload dependent, and modern (Java 5+) JVMs are very good at self-tuning - unless you have lots of data you're more likely to harm yourself than help with aggresive JVM tuning.
As mentioned on x86 architectures, the 64-bit EMT64 or x64 processors also include new instructions for doing things like atomic writes, or other options which may also impact high-performance applications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With