Reputation: 159
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
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
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
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