1

I have an out of space : perm gen error and I don't know what to do. I'm using apache tomcat but I don't have full access to the server.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
user2206141
  • 11
  • 1
  • 3
  • Show us some code, exception trace or something. – Manish Mar 25 '13 at 04:01
  • 1
    Don't tell me `Google` didn't show up any results for **Out of Memory: Perm Gen Space**! – Rahul Mar 25 '13 at 04:02
  • Basically there are 2 general approaches: 1. Reduce your memory consumption, 2. Increase memory capacity – gerrytan Mar 25 '13 at 04:08
  • This was a long standing bug with Tomcat, that the more recent versions finally fixed. So, probably you are using an old version of Tomcat. The problem related to memory located in static variables that wouldn't get released in between start and stops of a servlet. So, unless you are doing something crazy with static variables, update Tomcat. If you can't you'll just have to bounce Tomcat each time you get the error. – aepryus Mar 25 '13 at 04:20

2 Answers2

2

This indicates a memory leak* that is causing Java to create too many objects in Perm Gen, a section of memory reserved for very long-lived (permanent) memory. If you don't have full access to the server, it's either a) not your problem, and you should alert the system administrator or b) an issue with your code, which we can't help you with if you don't show what you're doing.

If you aren't sure if it's a) or b), try to revert your changes / see if anyone else is having the same issue. If no matter what you see this error, it's a). If you're able to stop this error by removing your code, it's b).

*It's possible you're doing everything exactly right, and simply need to increase the PermGen setting on your server, but since like you said it's not your machine, that seems unlikely to be the solution.

dimo414
  • 47,227
  • 18
  • 148
  • 244
  • It does not necessarily indicate a "leak"; it's entirely possible that the code being executed simply requires more resources than the default MaxPermSize. – TML Mar 25 '13 at 05:36
1

You can use :

-XX:MaxPermSize=128m to increase the space. But this ususally only postpones the inevitable.

You can also enable the PermGen to be garbage collected

Deepak
  • 327
  • 1
  • 7