wood burning stoves 2.0*
The moose likes Struts and the fly likes Servlet.service() for servlet action threw exception java.lang.OutOfMemoryError: PermGen space Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Servlet.service() for servlet action threw exception java.lang.OutOfMemoryError: PermGen space" Watch "Servlet.service() for servlet action threw exception java.lang.OutOfMemoryError: PermGen space" New topic
Author

Servlet.service() for servlet action threw exception java.lang.OutOfMemoryError: PermGen space

Mohit Kumar Tayal
Greenhorn

Joined: Aug 27, 2008
Posts: 29
Hello,

I am working on a web application developed in struts 1.2 framework. I am getting the error when i am redeploying the application:

Servlet.service() for servlet action threw exception java.lang.OutOfMemoryError: PermGen space

I have goggled but found solution to increase the memory size this not solves the problem but postponed the error.

Please tell me what may be the reason for getting this error and how to solve this permanently.

Thank you.
gokul subramanian
Greenhorn

Joined: Apr 06, 2010
Posts: 8
just restart the server... to resolve the error permanently just increase JVM
Mohit Kumar Tayal
Greenhorn

Joined: Aug 27, 2008
Posts: 29
Hi gokul,

i have tried this by increasing the size of jvm.

but is it the only way to postpone the problem.

please tell me why this problem comes and when this is going to happen.
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
The TomcatFaq discusses this issue.
Mohit Kumar Tayal
Greenhorn

Joined: Aug 27, 2008
Posts: 29
Hi i found one solution something saying this:

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled and -XX:+UseConcMarkSweepGC

but i am not getting where to change for this means how to get effect with these lines.

And also please tell me is this the right way to solve the problem.

gokul subramanian
Greenhorn

Joined: Apr 06, 2010
Posts: 8
Hi Mohit Kumar Tayal ,
can i know which ide are you using....
Mohit Kumar Tayal
Greenhorn

Joined: Aug 27, 2008
Posts: 29
Hi gokul,

I am using MyEclipse but the problem comes after deploying the application on live servers after 3-4 days on restarting the application not on my development system.

Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8876
    
    8

You can increase the size of the PermGen space. This will buy you time between occurrences, not fix the problem as Gokul states.
Follow Lester's link. This problem has to do with how the classloader works. There is no workaround that I have seen.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet.service() for servlet action threw exception java.lang.OutOfMemoryError: PermGen space