Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java programing for 64 bit JVM

Few Questions :):

How to identify what JVM is currently installed ? (64 bit / 32 bit)

Do I need to do some considerations while programming for 64 bit JVM target Platform ?

Can my Java code work on 32 bit as well as 64 bit JVM ?

How to run my Java App on 64 bit JVM ?

How to identify what JVM is being used for my Java App ?

like image 576
YoK Avatar asked Aug 10 '10 05:08

YoK


People also ask

What is 64-bit JVM?

The 64-bit JVM is especially useful for Java applications with large heaps, such as those that use more than 100 GB of memory as a maximum. Because the size of the OOP (Ordinary Object Pointer) has increased from 32 to 64 bits, the same Java application will use more memory in the 64-bit JVM than in the 32-bit JVM.

Is there a 64-bit version of Java?

Java is available on Microsoft Windows in 64 and 32 bit versions, allowing users to get the appropriate version for their system. Users can even run both side-by-side for 64 bit operating systems.


1 Answers

Normally a 64 bit jvm will identify itself as such.

32/64 bit Considerations I have seen:

  1. address space - if you're not expecting to address more that 1.3Gb of memory then you won't see a difference
  2. native libraries - if you're loading any JNI libs, then they will need to match your VM architecture. For example, don't try loading 32-bit native libraries from a 64-bit vm (without -d32 type of flags)

Yes, the same code will run on both JVMs.

System Property "sun.arch.data.model" has the 32/64 flag I think.

There's some helpful info here: http://www.oracle.com/technetwork/java/hotspotfaq-138619.html

like image 131
Paul Jowett Avatar answered Oct 02 '22 07:10

Paul Jowett