0

I get this error doing my build:

[ERROR] PermGen space -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/OutOfMemoryError

with java 7. Help?

wemu
  • 7,952
  • 4
  • 30
  • 59
rogerdpack
  • 62,887
  • 36
  • 269
  • 388
  • You are facing this during a normal build ? – khmarbaise Apr 04 '20 at 08:53
  • Yeah. Not sure at which exact phase... – rogerdpack Apr 04 '20 at 14:42
  • Large build? On which JDK and which Maven version are you running...Are running your build inside a container etc. ? Plain command line? – khmarbaise Apr 04 '20 at 15:28
  • command line, JDK 7, maven 3.6. Yeah large build :) – rogerdpack Apr 04 '20 at 23:16
  • Can you give a number what you mean by large build cause I had builds with 800+ modules in a single build where I didn't had the need for this? Or do you tests causing that? Unit or integration tests? – khmarbaise Apr 05 '20 at 11:54
  • 1
    Something like that I have expected. Pulling a dependency will only be done once and should not influence tests except the tests are integration tests ? – khmarbaise Apr 06 '20 at 16:09
  • Running with `maven install -DskipTests` it doesn't fail so I assume it's running out of Perm Gen doing the unit tests. Or something like that? This particular case is very weird, it actually runs out of Perm Gen "once" (the "first time") then after that it works OK. It's possible it pulls in some very large 3rd party dependencies or something like that, I don't understand the project well. – rogerdpack Apr 06 '20 at 16:13
  • Yeah could be IT or some plugin... – rogerdpack Apr 06 '20 at 16:14
  • 1
    Pulling is unrelated I suppose but without the full logoutput it's hard to guess. Check also via `mvn clean verify -DskipTests` and the output is important ...furthermore Do you have configured some memory settings in you environment? MAVEN_OPTS etc.? Running from plain command line? – khmarbaise Apr 06 '20 at 17:34

1 Answers1

1

This seems to do it (the MaxPermSize part):

export MAVEN_OPTS="-XX:MaxPermSize=128m"

http://cwiki.apache.org/confluence/display/MAVEN/OutOfMemoryError

There are also other ways to set it for a specific project.

Apparently the concept of MaxPermSize was removed in java 8, FWIW.

rogerdpack
  • 62,887
  • 36
  • 269
  • 388