Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
346 views
in Technique[技术] by (71.8m points)

64 bit - Benefits of 64bit Java platform

I'm an absolute n00b into the java platform I would like to know whether I need to change anything in my code to get the benefits of 64bit JRE ?

or is it something like when I initiate it with "java -d64" its gonna run in some turbo mode?

Your help is highly appreciated

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

My previous version, while not false, was a quickly written oversimplification.

Changing from 32 to 64 bits will not automatically make your application run faster, it may in some cases lead to the opposite. On the "negative" side Doing de-referencing of memory pointers in the JVM can take a longer time with 64 bit pointers than 32 bit. A full garbage collect and compaction of a 16 GB heap will likely take a longer time than with a 2 GB heap.

On the positive side: There 64 bit processor instructions that are more effective than the 32 bit ones. 64 bit JVM will allow you to have a heap size 2^32 times bigger than the, slightly less than, 4 GB one you can get with 32 bit. (If you can afford to buy that amount of RAM) Some JVMs can work with compressed references if you have a heap size less than 4 GB, giving you the advantage of 64 bit instructions without having to pay the 64 bit de-referencing price.

If you have a good JVM I would go to 64 bits no matter the heap size, just be prepared that you may have to take a performance hit for having a really big heap.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...