Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.OutOfMemoryError: PermGen space

How can I prevent this?

Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-2" java.lang.OutOfMemoryError: PermGen space

It's happening for example if I reloading datatable page often. I understand it that there is something wrong set with garbage collector..

I'm using Eclipse Java EE IDE, JSF2, richfaces4

like image 914
gaffcz Avatar asked Jan 19 '23 15:01

gaffcz


1 Answers

This is specific to Tomcat. It's pretty a poor hotpublisher/hotdeployer and it suffers from memory leaks. I'd suggest to turn off autopublishing by the server configuration screen in Eclipse and just manually restart Tomcat whenever you want to reflect the saved changes. Restarting shouldn't take much time anyway if you have only one project.

Glassfish, for example, is much more robust (and faster!) when it comes to hotpublishing. As to how to install Glassfish and integrate it in Eclipse for JSF 2.0 development, check this tutorial.

like image 148
BalusC Avatar answered Jan 24 '23 20:01

BalusC