You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Rick Rineholt <cr...@gmail.com> on 2006/04/29 22:55:46 UTC

java.lang.OutOfMemoryError: PermGen space

I received the below error on  builds ..    added the following javac 
arguments to mvn.bat to resolve: -XX:MaxPermSize=128m -XX:PermSize=64m
Don't ask me what, or why answer provided via Googling.  YMMV
[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


Re: java.lang.OutOfMemoryError: PermGen space

Posted by Jeremy Boynes <jb...@apache.org>.
I've seen this on builds before albeit with Maven 1. I believe this
happens when the build creates a large number of classloaders which
are not garbage collected quickly enough (or when there are class
reference leaks). The workaround was the same as the one you show  (at
least for the Sun JVM).

This may be an indicator that we have a classloading issue.

--
Jeremy

On 4/29/06, Rick Rineholt <cr...@gmail.com> wrote:
> I received the below error on  builds ..    added the following javac
> arguments to mvn.bat to resolve: -XX:MaxPermSize=128m -XX:PermSize=64m
> Don't ask me what, or why answer provided via Googling.  YMMV
> [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
>
>

Re: java.lang.OutOfMemoryError: PermGen space

Posted by Kevin Williams <ke...@qwest.net>.
More specifically, you can set these options with the following at the 
top of the mvn.bat file:

    set MAVEN_OPTS=-XX:MaxPermSize=128m -XX:PermSize=64m



Rick Rineholt wrote:

> I received the below error on  builds ..    added the following javac 
> arguments to mvn.bat to resolve: -XX:MaxPermSize=128m -XX:PermSize=64m
> Don't ask me what, or why answer provided via Googling.  YMMV
> [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
>
>
>
>



Re: java.lang.OutOfMemoryError: PermGen space

Posted by Daniel Kulp <da...@iona.com>.
On Saturday 29 April 2006 16:55, Rick Rineholt wrote:
> I received the below error on  builds ..    added the following javac
> arguments to mvn.bat to resolve: -XX:MaxPermSize=128m -XX:PermSize=64m
> Don't ask me what, or why answer provided via Googling.  YMMV
> [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

We've hit this with Celtix on all our 64bit platforms.   There are two 
basic approaches to fixing/working around it:

1) Fork everything.  Setup both javac and surefire to fork.   By default, 
both of them run in the same vm as maven.  Also, update   There are two 
issues with this:    
  a)  Forking javac doesn't seem to always work on the mac.   It sometime 
cannot find javac.   No idea why.  (that was with Maven 2.0.2 though, it 
may be fixed)
  b)  The system classpath is different with surefire forked.   If a test 
relies on a system classpath item, it may break.  However, if a test 
relies on that, its a bad test and deserves to break.  :-)


2) The MaxPermSize flag changes you mentioned.   Usually, we set them in 
MAVEN_OPTS variable in our .bashrc files.

Enjoy!
-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727  C: 508-380-7194
daniel.kulp@iona.com