mardi 24 juin 2008

Problème de mémoire avec maven

%MAVEN_JAVA_EXE% %MAVEN_OPTS%  -Xmx1024m -classpath
%CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf"
"-Dmaven.home=%M2_HOME%" org.codehaus.classworlds.Launcher
%MAVEN_CMD_LINE_ARGS%



The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError: Java heap space
at com.sun.tools.javac.code.Scope$ImportScope.makeEntry(Scope.java:385)
at com.sun.tools.javac.code.Scope.enter(Scope.java:196)
at com.sun.tools.javac.code.Scope.enter(Scope.java:183)
at com.sun.tools.javac.comp.MemberEnter.importAll(MemberEnter.java:132)
at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:509)
at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758)
at com.sun.tools.javac.comp.Enter.complete(Enter.java:451)
at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
at com.sun.tools.javac.main.Main.compile(Main.java:353)
at com.sun.tools.javac.main.Main.compile(Main.java:279)
at com.sun.tools.javac.main.Main.compile(Main.java:270)
at com.sun.tools.javac.Main.compile(Main.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:420)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:141)
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:493)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)


Les tests unitaires lancés avec maven provoquent des erreurs de mémoire, il est possible de changer le fork afin d'instancier une JVM par test. Par défaut le fork utilisé est once (un seul fork)

<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>pertest</forkMode>
<argLine>-enableassertions</argLine>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>

Aucun commentaire: