Skip to content
Advertisement

Is it possible to install 64 bit JVM on linux so heap can be larger then 2gb?

It’s a 32 bit Ubuntu OS

rob@laptop:~$ uname -a
Linux laptop 3.5.0-37-generic #58~precise1-Ubuntu SMP Wed Jul 
10 17:51:56 UTC 2013 i686 i686 i386 GNU/Linux


rob@laptop:~$ java -version
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.12.04.2)
OpenJDK Server VM (build 23.7-b01, mixed mode)


rob@laptop:~$ sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).

Selection    Path                                           Priority   Status
0            /usr/lib/j2re1.6-ibm/jre/bin/java               1200      auto mode
1            /home/rob/Downloads/jre1.7.0_25/bin/java        1         manual mode
2            /usr/lib/j2re1.6-ibm/jre/bin/java               1200      manual mode
* 3            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1051      manual mode

I want to be able to run with more than 2g of heap

rob@laptop:~$ java -Xmx3g -jar tool.jar 
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

rob@laptop:~$ free -g
             total       used       free     shared    buffers     cached
Mem:            15          2         12          0          0          1

Advertisement

Answer

No. A 32-bit kernel(and likely 32-bit CPU as well) cannot run a 64-bit executable for the JVM(or any other 64-bit executable/ELF) with your choice of OS and kernel.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement