Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
PAE only means the kernel can use more than 4GB. Each process is still limited to 32-bit address, hence can only address 2/3/...GB depending on how much address is reserved for kernel space – Lưu Vĩnh Phúc Apr 1 at 9:49

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


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.