Dec 29 2011

Beware Of The Heap Size On HotSpot 64-Bit JVM's

Posted by Mike Brunt at 12:35 PM Tomcat | Performance | JavaEE | Caching | Java-JVM | JRun-J2EE


I have known for some time that on reaching a 32GB sized heap in the 64-bit Hotspot JVM there is a loss of heap storage space.  It turns out that is because of the object pointer size which in JVM's up to 32GB are compressed.  As soon as we hit anything over 32GB that compression ceases and with many objects in the heap that can make a significant difference, as much as a 30% loss of heap space in extreme cases.  The next optimal number after 32GB in order to negate the loss is around 48GB, so it is far better not to go above 32GB unless you go to at least 48GB.

This is important insight is in an excellent presentation given by Attila Szegedi an engineer from Twitter relating to all things JVM located here.  This was pointed out to me by Dan Wilson a great friend and colleague of mine.