<< Stripes Google Web Toolkit integration | Home | mysql-front is alive >>

use JRockit to avoid permGenSpace out of memory errors

do you want to get rid of permGenSpace errors during development?

It's a problem that allmost all java developer knows: With every hot deployment on a java application server or servlet engine the heap space memory consumption grows and grows.

See for example the following screenshots that shows the heap status of kinokai.de - a Stripes application after the first deployment and after the fifth hot deployment (automatically done by jetty using the maven plugin).

After the initial deployment

After the fifth hot deployment - having the following in the console:

PermGenSpace errors mainly occur due to static class references that get not garbage collected after the hot deployment. Often commons logging is blamed for this but there is a bunch of other java libraries that could cause this as well. Hot deployment is normally only done on development so this problem is not mission critical but think of all the "legacy" applications out there that can not be tested or developed without an application container

This is the point where JRockit comes to the rescue. I don't exactly know why, but with jRockit I was able to peform a dozens of hot deployments of my application - without running into any out of memory errors! It would be interesting though - but sometimes a developer needs to be pragmatic, right? Maybe jRockit just usese more of the system memory? I don't care as long as I don't have to restart the jetty process all the time ;-)




Add a comment Send a TrackBack