Kamis, 01 Mei 2014

What is -XX:+UseCompressedOops in 64 bit JVM




-XX:+UseCompressedOops JVM command line option is one of the most talked option of 64 bit JVM. Though 64 bit JVM allows you to specify larger Java heap sizes it comes with a performance penalty by using 64 bit OOPS. Ordinary object pointers also known as OOPS which is used to represent Java objects in Virtual Machine has an increased width of 64 bit than smaller 32 bit from earlier 32 bit JVM. because of increased size of OOPS, fewer OOPS can be stored in CPU cache registers which effectively reduced CPU cache efficiency. -XX:+UseCompressedOops enables use of compressed 32 bit OOPS in 64 bit JVM which effectively compensate performance penalty imposed by 64 bit JVM without scarifying heap size advantage offered by them. You should use -XX:+UseCompressedOops if maximum heap size specified by -Xmx is less than 32G. This is my 3rd article on JVM after 10 JVM option Java programmer should know and  how to find 32 bit JVM or 64 bit JVM, I suggest reading those if you want to learn more about JVM.






Why should you use -XX:+UseCompressedOops JVM option



-XX:+UseCompressedOops JVM option example-XX:+UseCompressedOops JVM option neutralize penalty imposed by 64 bit JVM. By using -XX:+UseCompressedOops you can avail benefit of both 64 bit JVM in terms of larger Java heap size and 32 bit JVM in terms of compressed size of OOPS which results in better performance by utilizing CPU cache better than larger, space inefficient 64 bit OOPS pointers. Since better application performance is directly proportional to better CPU cache utilization, -XX:+UseCompressedOops allows you to get most of your available CPU registers along with additional CPU registers provided by some platforms like AMD x64. Some people may argue that further expansion of 32 bit compressed OOPS into 64 bit pointers may slow down things but that shouldn't be problem with modern high end processors.





Though its important to note that use of Compressed Oops option limits your heap size up to 32Gigs which is still more than handy but yes  a limitation if you looking for seriously gigantic heap.





That's all on What is UseCompressedOops JVM option and Why should you use -XX:+UseCompressedOops in 64 bit JVM. Importance of this option can also be realized by fact that from Java 6 update 18 Oracle by default enable -XX:+UseCompressedOops in HotSpot JVM based upon maximum Java heap size.








Other Java article you may like from Javarevisited blog













Reference

























Source:http://javarevisited.blogspot.com/2012/06/what-is-xxusecompressedoops-in-64-bit.html

Tidak ada komentar:

Posting Komentar