Permanent Generation is a separate region in memory used to store internal representations of Java classes. Developers do not access this region directly, most of the iteractions with the region are handled by ClassLoaders. So how is it possible to leak something you cannot even directly touch?

As you most likely have noticed in your error logs - you can. Especially during the redeploy phases in your Java EE applications when under the hood old classloaders get discarded and new classloaders are created. And more often than not applications are written in a way that the old classloaders cannot be garbage collected, leaving thousands of class definitions occupying up to 20MB into the PermGen area. 

I have summarized our experience with PermGen leaks into the blog post. I will cover the core concepts, such as ClassLoaders and Permanent Generation, describe two case studies on how does a typical leak occur in PermGen and give guidelines on how to fix those types of leaks.