O
O
Osklizg2017-05-10 15:20:05
Java
Osklizg, 2017-05-10 15:20:05

How to fix java.lang.OutOfMemoryError: PermGen space error?

I'm trying to build the project, at a certain stage it displays:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project isup-impl: Compilation failure
[ERROR ] Failure executing javac, but could not parse the error:
[ERROR]
[ERROR]
[ERROR] The system is out of resources.
[ERROR] Consult the following stack trace for details.
[ERROR] java.lang.OutOfMemoryError: PermGen space
[ERROR] at java.lang.ClassLoader.defineClass1(Native Method)
[ERROR] at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
[ERROR] at java. security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[ERROR] at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
[ERROR] at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
[ERROR] at java.net.URLClassLoader$1.run( URLClassLoader.java:354)
[ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
[ERROR] at java.security.AccessController.doPrivileged(Native Method)
[ERROR] at java.net.URLClassLoader. findClass(URLClassLoader.java:347)
[ERROR] at org.codehaus.plexus.compiler.javac.IsolatedClassLoader.loadClass(IsolatedClassLoader.java:56)
[ERROR] at com.sun.tools.javac.code.Types.(Types .java:101)
[ERROR] at com.sun.tools.javac.code.Types.instance(Types.java:88)
[ERROR] at com.sun.tools.javac.jvm.ClassReader.(ClassReader.java: 264)
[ERROR] at com.sun.tools.javac.jvm.ClassReader.instance(ClassReader.java:226)
[ERROR] at com.sun.tools.javac.main.JavaCompiler.(JavaCompiler.java:331)
[ERROR] at com.sun.tools.javac.main.JavaCompiler.instance(JavaCompiler.java:88)
[ERROR] at com.sun.tools.javac.main.Main.compile(Main.java:424)
[ERROR] at com .sun.tools.javac.main.Main.compile(Main.java:353)
[ERROR] at com.sun.tools.javac.main.Main.compile(Main.java:342)
[ERROR] at com.sun .tools.javac.main.Main.compile(Main.java:333)
[ERROR] at com.sun.tools.javac.Main.compile(Main.java:94)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:606)
[ERROR] at org.codehaus.plexus.compiler. javac.JavacCompiler.compileInProcess(JavacCompiler.java:420)
[ERROR] at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:141)
[ERROR] at org.apache.maven.plugin.AbstractCompilerMojo. execute(AbstractCompilerMojo.java:493)
[ERROR] at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java: 101)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[ERROR] -> [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] cwiki.apache.org/confluence/display/MAVEN/MojoFail...
[ERROR]
[ERROR ] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :isup-impl
As I understand it, the error is in the lack of PermGen space.
I set the parameters with the following command: export JVM_ARGS="-Xmx1024m -XX:MaxPermSize=256m"
MaxPermSize set both 512m and 1024m.
Maybe that's not the error? Or am I setting the parameters incorrectly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
protven, 2017-05-10
@Osklizg

In general, maven has its own environment variable - MAVEN_OPTS. Try to expose it. But in general, it is, to put it mildly, strange that when building a project, OOM PermGen comes out. What do you collect, if not a secret?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question