Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
399 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...