cancel
Showing results for 
Search instead for 
Did you mean: 

Maven error: could not reserve enough space for xxx object heap

soulcollector
Champ on-the-rise
Champ on-the-rise

Hello

I was following this good tutorial to get started with Alfresco and custom content models.

Everything ok until i decided to use Eclipse and imported my project. Since then, maven can't compile anymore, not even if i copy/paste the exact xml files (i retried to follow it without reading), or even if i change folder and start it anew.

Error "could not reserve enough space for xxx object heap" comes when surefire starts to test and prevents me from starting any project. Trying to set the MAVEN_OPTS variable was useless at any amount of memory specified. Anyone knows how to fix this? Thank you.

7 REPLIES 7

openpj
Elite Collaborator
Elite Collaborator

Have you configured the Run configuration panel in Eclipse?

You have to set the same Maven options also inside the JRE environment for running Maven directly from Eclipse.

Hope this helps Smiley Happy

It affects the execution of Maven even when i'm not using Eclipse? Where should i go? I see no configuration panel under Run and if i go to Preferences/Run-Debug no option looks like doing such thing.

Please see the following article, specifically where it describes how to set JRE arguments in Eclipse:

Creating a Share project with Eclipse | Alfresco Documentation

Thank you

bhagyas
Champ on-the-rise
Champ on-the-rise

Which version of Maven are you using?

Make sure you are running Java 8 JDK with Maven 3.0 or above.

Running Maven 3.3.9 with Java 8

Maven 3.3.9 with Java 8 don't need to set MAVEN_OPTS.

When you execute maven command ,did you run any other processes ? ,Maybe too many other processes consume so much  OS memory  that there is not enough OS memory to hold your maven java  process.