Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mohit Kumar Tayal
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just restart the server... to resolve the error permanently just increase JVM
 
Mohit Kumar Tayal
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The TomcatFaq discusses this issue.
 
Mohit Kumar Tayal
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mohit Kumar Tayal ,
can i know which ide are you using....
 
Mohit Kumar Tayal
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 9258
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic