Reputation: 21
I am receiving the following error when trying to build a Java project in IntelliJ 14.0.3 with Apache Maven:
Error: Abnormal build process termination
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine
Error: A fatal exception has occurred. Program will exit.
I am using Java 1.7.0_75. However, if I switch the project to use Java 1.8.0_25 then the project will build. The only issue with this is that I am using Spring 2.5, which thinks that Java 1.8 is Java 1.4 and this causes other problems. Unfortunately upgrading Spring is not an option.
I am running Windows 7 Enterprise 64 bit with 8gb of RAM, recently upgraded from 4gb. There is plenty of free memory available when I am getting this error, and I've allocated 1024mb to IntelliJ in the idea.exe.vmoptions
file.
This problem doesn't seem to happen for other people building the same project with the same version of Java. They are using IntelliJ 13.1.4, and they also have only 512mb allocated in idea.exe.vmoptions.
I originally was using IntelliJ 13.1.4 as well and receiving a similar error to what I'm receiving now.
Any ideas on what might be happening?
EDIT: For anyone who is interested, I still haven't figured out this error. I had my computer completely reimaged and the issue still seems to be occurring, which leads me to believe it could actually be something physical. I was also considering that maybe it has something to do with a memory leak or fragmented memory causing malloc to fail when java tries to allocate memory, but I'm not sure why that would be the case - especially when the same setup seems to work on other peoples' computers.
Upvotes: 2
Views: 1963
Reputation: 1954
I got the same error when trying to run the application using Run-->Debug and the "Error: Abnormal build process termination" message just wouldn't go away. I then tried running the application using Run-->Run and it ran successfully. Went back and tried to Debug the application and it started working. Not sure if this would have helped in your case but thought I'd share my experience.
Upvotes: 0
Reputation: 2485
Do you have explicit memory settings for XX:MaxPermSize=
perhaps? This error means that the JVM couldn't startup because the options presented to it didn't leave enough memory for the heap space.
The difference with Java 8 is probably because Java 8 no longer has a permanent generation space in the JVM, so the XX:MaxPermSize
option gets ignored.
See Could not reserve enough space for object heap as an example of this kind of error.
You can change the memory options that would be passed to the maven commands in the IntelliJ Preferences under Build, Execution, Deployment > Build Tools > Maven > Runner
and set them in the VM Options
text box. Working under the assumption you have a XX:MaxPermSize
setting already, you could try something like this:
-XX:MaxPermSize=256m -Xmx1024m
Which sets the max allocation pool to 1024 MB
and up to 256 MB
for the PermGen
Upvotes: 1