pikameuh
pikameuh

Reputation: 159

PermGen space - maven m2e tomcat7

I try to deploy a war on tomcat with maven. When I run with maven goal tomcat7: run. Tomcat seems to launch maven connects to the database, then I have the right to error:

java.lang.OutOfMemoryError: PermGen space

I use m2e, eclipse and tomcat. I tried to add in POM.xml :

<configuration>
  <systemProperties>
    <JAVA_OPTS>-Xms256m -Xmx512m -XX:MaxPermSize=256m</JAVA_OPTS>
  </systemProperties>
</configuration>  

And in the JRE parameter of maven :

-Xms256m -Xmx512m

But nothing happens ..

Do you have any idea? Another way to solve that error ?

Upvotes: 1

Views: 1770

Answers (3)

souravan roy
souravan roy

Reputation: 1

If you are working in command prompt : http://cwiki.apache.org/confluence/display/MAVEN/OutOfMemoryError

If you are working in IDE : Server > VM Arguments and add followings

-Xmx2048m -XX:MaxPermSize=1024m

Upvotes: 0

Nirav Prajapati
Nirav Prajapati

Reputation: 3005

if you use eclipse IDE than with use of it you can change the VM argument

double click on the server > open Lunch Configuration > Arguments > VM Arguments

and append below two lines in your VM Arguments field

-Xms256m -Xmx1024m -XX:+DisableExplicitGC -Dcom.sun.management.jmxremote
-XX:PermSize=256m -XX:MaxPermSize=512m

it will sure solve your problem

Upvotes: 2

Ved
Ved

Reputation: 8767

Add these parameters in config file -

MAVEN_OPTS=-Xms512m -Xmx1024m

Alternatively, you can set them using command prompt if you run from command line directly like -

set MAVEN_OPTS=-Xms512m -Xmx1024m

Upvotes: 2

Related Questions