Personal tools
gvSIG Desktop
gvSIG Desktop

Cached time 11/21/13 16:43:13 Clear cache and reload

 
It is possible that for some of the tasks Maven launches, such as the compilation of Java classes, or the generation of Javadoc, the default memory settings will not be enough.

If this happens, an OutOfMemoryError message will appear in the console. We can increase the maximum memory allocation of the JVM by defining the *MAVEN_OPTS* variable that allows us to pass parameters to the JVM that launches Maven. For example:

Linux::

    export MAVEN_OPTS=-Xmx256M

Windows::

    set MAVEN_OPTS=-Xmx256M

When there is not enough space for the loading of classes (PermGenSpace), this will produce an error like::

  [INFO] Compilation failure
  Failure executing javac, but could not parse the error:

  The system is out of resources.
  Consult the following stack trace for details.
  java.lang.OutOfMemoryError: PermGen space
  	at java.lang.ClassLoader.defineClass1(Native Method)
  	at java.lang.ClassLoader.defineClass(ClassLoader.java:621)

In this case, we will need to increase the PermGen space with the *-XX:MaxPermSize* parameter. For example: 

Linux::

    export MAVEN_OPTS=-Xmx256M -XX:MaxPermSize=64m

Windows::

    set MAVEN_OPTS=-Xmx256M -XX:MaxPermSize=64m

View source document


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: