Invalid maximum heap size?
Asked Answered
G

1

5

I am running an grails application for my project in IntelliJ and I have set the vm options to :

-Dserver.port=8080 -Xms3g -Xmx3g -XX:-UseGCOverheadLimit -Xverify:none

The logs are :

Running Grails application

Invalid maximum heap size: -Xmx4096M

The specified size exceeds the maximum representable size.

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

Error | Forked Grails VM exited with error

Please help me with that ?

Garage answered 15/6, 2020 at 11:1 Comment(1)
How much RAM you have available? What operating system do you use? Which JDK have you installed?Bendick
T
7

If your JVM is 32bit, then heap size should be lower than 4gb. Either you can install 64bit JVM, or set the maximum heapspace to 2GB with -Xmx2048M. I had similar problem and this worked for me, hope this helps you as well.

Target answered 15/6, 2020 at 11:16 Comment(7)
i have jdk installed amd-64 does it includes jvm ?Garage
please run "java -version" in command line to see whether jvm 32 or 64. And yes jdk contains everything that is in the jre, because jdk is superset of jreTarget
I have ubuntu installed it is not showing whether jdk is 32 bit or 64 bit. Please help.Garage
Please tell me what you see on the third line when you open your terminal and run the following command: java -version. you should be seeing OpenJDK 32 or 64 -BitTarget
Java HotSpot(TM) Server VM (build 25.25-b02, mixed mode) This is written in 3 line.Garage
You have 32 Bits OracleTarget
This is most likely the issue because clicking the big red button on java.com/en/download automatically downloads the 32-bit. That was my issue. The 64-bit installation lives here: java.com/en/download/manual.jsp.Rayborn

© 2022 - 2024 — McMap. All rights reserved.