Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a 32bit version of Ubuntu server with PAE active allow for the full use of the 8gb of RAM but I can't use more than 2gb of RAM in Java. I run the command

java -Xms6G -Xmx7G -jar server.jar

and I get the error:

Invalid initial heap size: -Xms6G
The specified size exceeds the maximum representable size.
Could not create the Java virtual machine.

do I need to change something with Java? The server is 32bit so PAE is active to allow for the server to use all the 8gb of RAM.

share|improve this question

1 Answer 1

The fact that you have a PAE kernel doesn't really matter here, a 32 bit JVM suffer this limit, you can try to adopt a 64 bit memory model on a JVM by invoking

java -d64

but this will probably fail if you have a 32 bit only JVM. So get yourself a 64 bit JVM if you want to solve this.

share|improve this answer
    
To get a 64bit JVM, though, you'll need a full 64bit OS, which would require a reinstallation of Ubuntu. –  Thomas W. Dec 25 '12 at 15:46
    
@LordofTime it's also possible to install 2 kernels/OS in the same partition, but it's not an easy thing to manage and also I would not do that on a server. 64 bit OSs are the must if you want to setup a server this days ... –  user1849534 Dec 26 '12 at 1:29
    
Eeeyup. Why else would I say you'd need a full 64bit OS? :P –  Thomas W. Dec 26 '12 at 1:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.