Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java - Invalid maximum heap size

When running project from IntelliJ IDEA I set VM options -XX:MaxPermSize=512m -Xmx=256m -Xms=256m and get the following error

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

like image 685
naXa Avatar asked Feb 28 '18 14:02

naXa


People also ask

How do I fix invalid max heap size?

If you look carefully you will space between -Xmx and 1800M, which is causing "Could not create the Java virtual machine: Invalid maximum heap size -Xmx". syntactically there should not be any space between -Xmx and heap size. Just remove the space between -Xmx and 1400M and it will work.

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 maximum heap size for 64 bit JVM?

For 64 bit platforms and Java stacks in general, the recommended Maximum Heap range for WebSphere Application Server, would be between (4096M - 8192M) or (4G - 8G).


1 Answers

Remove the equals sign after Xmx and Xms.

Correct VM options: -XX:MaxPermSize=512m -Xmx256m -Xms256m.

like image 166
naXa Avatar answered Sep 20 '22 12:09

naXa