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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…