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.