Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Invalid maximum heap size

I just installed Ubuntu 64Bit on my VServer and JRE build 1.7.0_67-b01. If I want to run a java jar-file it says

Invalid maximum heap size: -Xmx Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

java -help says

java version "1.7.0_67" Java(TM) SE Runtime Environment (build 1.7.0_67-b01) Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

I tried 1M, 256M, 1024M, 2G and 4G for -Xmx, nothing works. Is there a hidden setting I don't know?

Here's the command I use:

java -Xmx 1024M -Xms 1024M -jar MyConverter.jar
like image 972
Yss Avatar asked Aug 07 '14 19:08

Yss


People also ask

What is invalid maximum heap size?

Invalid heap size On other environments like Windows and Linux, 32 bit and 64 bit JVM are installed separately. 64 bit JVM installed on Solaris machines runs with a 32-bit model if you don't specify either -d32 or -d64, which won't accept a Maximum heap size of 4GB, hence "invalid heap size".

What is the maximum heap size in Java?

The default maximum heap size for the Java™ data provider is 256 megabytes. You must set the maximum heap size to an appropriate value that depends on the size of the VMware environment.

What is the max heap size for 64 bit JVM?

Max Heap Size. The maximum theoretical heap limit for the 32-bit and 64-bit JVM is easy to determine by looking at the available memory space, 2^32 (4 GB) for 32-bit JVM and 2^64 (16 Exabytes) for 64-bit JVM. In practice, due to various constraints, the limit can be much lower and varies given the operating system.


1 Answers

Remove the space after Xmx and Xms

like image 143
Xabster Avatar answered Oct 12 '22 23:10

Xabster