Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

64 Bit Java for small stand alone applications

Tags:

java

Is it really a worth migrating small stand alone java applications (Max : 100-200MB heap) on 64 bit Java. Are there any specific advantages; My observation is , it just increases memory footprint of the application.

Please post your experiences / opinions.

like image 835
Dhananjay Avatar asked May 27 '26 01:05

Dhananjay


2 Answers

From the official FAQ:

What are the performance characteristics of 64-bit versus 32-bit VMs?

Generally, the benefits of being able to address larger amounts of memory come with a small performance loss in 64-bit VMs versus running the same application on a 32-bit VM. This is due to the fact that every native pointer in the system takes up 8 bytes instead of 4. The loading of this extra data has an impact on memory usage which translates to slightly slower execution depending on how many pointers get loaded during the execution of your Java program. The good news is that with AMD64 and EM64T platforms running in 64-bit mode, the Java VM gets some additional registers which it can use to generate more efficient native instruction sequences. These extra registers increase performance to the point where there is often no performance loss at all when comparing 32 to 64-bit execution speed.
The performance difference comparing an application running on a 64-bit platform versus a 32-bit platform on SPARC is on the order of 10-20% degradation when you move to a 64-bit VM. On AMD64 and EM64T platforms this difference ranges from 0-15% depending on the amount of pointer accessing your application performs.

I'd say, if it isn't broken, don't fix it.

like image 69
mindas Avatar answered May 28 '26 15:05

mindas


If you switch to 64-bit on x64 you can take advantage of the 64-bit registers and additional registers. This might improve performance by 5%.

You can use -XX:+UseCompressedOops to use the same memory footprint (it uses 35-bit address space, up to 32 GB in 32-bit values) but I have found it ends up costing about 5% of performance.

like image 25
Peter Lawrey Avatar answered May 28 '26 14:05

Peter Lawrey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!