Toma
Toma

Reputation: 390

OutOfMemory PermGen error - ways to get this error

Is it possible to get this error on tomcat server in other way then redeploy wars or edit jsp files? We got this error on server where theoretically we don't do redeploys. Do you know best solution to monitor PermGen from linux console?

Upvotes: 1

Views: 251

Answers (4)

Bilbo Baggins
Bilbo Baggins

Reputation: 3019

permGen means Permanent generation, this is the place where all your constant are stored like strings (in most cases before java 7) were stored on this permgen, One way to get rid of it is you simply increase the memory using

-XX:PermSize=512m

This is what I did, but from your scenario it feels like there is some kind of memory leak, I am not sure how to detect it, there are frameworks available for this and netbeans also provides application profiling support.

Here are some good links http://www.eclipse.org/tptp/home/documents/tutorials/profilingtool/profilingexample_32.html

http://www.ej-technologies.com/products/jprofiler/overview.html

https://netbeans.org/kb/docs/java/profiler-intro.html

Upvotes: 1

NickDK
NickDK

Reputation: 5197

I remember the default permgen on Tomcat being pretty low, if you have a decent sized application with a lot of third party dependencies this can cause loads of classes to reside in pergmen. You could legitimately need more pergmen space, try increasing it.

Upvotes: 0

Vitalii Pro
Vitalii Pro

Reputation: 313

There is a tool for remote monitoring of VM: http://visualvm.java.net/

Upvotes: 0

FazoM
FazoM

Reputation: 4956

It doesn't have to be because of redeployments or more over a file edits. It is more likely that your Java apps on the server are using up all allocated memory. So yes, it is possible to get this error on tomcat server in other way then redeploy wars or edit jsp files.

When it comes to monitoring you might be interested in this API: http://docs.oracle.com/javase/7/docs/api/java/lang/management/MemoryMXBean.html

Or try looking for a monitoring software by typing tomcat monitor permgen in Google - lots of results are being returned.

Upvotes: 0

Related Questions