views:

186

answers:

2

I'm using the Maven plugin for embedded Glassfish - here's my plugin declaration:

<plugin>
  <artifactId>maven-glassfish-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <version>1.0-alpha-4</version>
  <configuration>
    <httpPort>8080</httpPort>
  </configuration>
</plugin>

After several clicks through my data-intensive web app, I run out of PermGen space.

java.lang.OutOfMemoryError: PermGen space

I've already configured MAVEN_OPTS to use more memory:

set MAVEN_OPTS=-Xmx1024m

But it looks like the Java process spawned by mvn glassfish:run is only getting about half a gigabyte of memory before it seizes up.

Does the Glassfish plugin have any configuration settings for upping its memory?

Thanks!

A: 

After further consultation with some colleagues, it seems I was increasing the wrong memory value in Maven.

To increase PermGen space, I added this to my MAVEN_OPTS:

set MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=1024m
jabbett
A: 

Just to clarify. The permanent generation space contains loaded class objects and interned strings. It is allocated outside of the Java heap as illustrated below:

alt text

On recent Sun VMs, the default maximum size is 64m (i.e. -XX:MaxPermSize=64m) and is adequate for most applications (the problem is very likely related to frequent undeploy/redeploy here though). I would anyway try with -XX:MaxPermSize=128m or -XX:MaxPermSize=256m, 1024m seems really oversized!

Pascal Thivent