alexmm
alexmm

Reputation: 99

Increase PermGen space (Tomcat7, Windows Service)

I'm running Tomcat7 as a service on a Windows 2008 Server and from time to time I get the "OutOfMemory Exception" due to the PermGen space.

I read in another thread that using a setenv.bat doesnt work when running Tomcat as a service (because catalina.bat is not used, hope thats correct). I usually use the "Configure Tomcat" GUI to set the memory pool for Java (min, max), but there is not specific option for the Perm space as far as I can see.

Can I set that value in the Java Options field of the GUI somehow? Or how do I do that?

Regards Alex

Upvotes: 1

Views: 1017

Answers (2)

Rahul
Rahul

Reputation: 677

Seems like this is what you are looking for:

http://umpteenchoices.blogspot.com/2011/05/tomcat-7-windows-service-memory.html

As per the link:

To set the Permgen size, you need either -XX:PermSize=XXXm or -XX:MaxPermSize=XXXm. This can be set on the Java tab of the Monitor Tomcat GUI, this time as a Java Option.

enter image description here

Upvotes: 1

PowerStat
PowerStat

Reputation: 3819

Yes you could set that in the jvm options field for example

-XX:MaxPermSize=256m

For the case that your problem exists (but only comes up later) then you should profile your application for memory leaks.

Upvotes: 2

Related Questions