We have an application that generates thousands of Java ClassLoaders and classes, before letting them be garbage collected. We are pretty sure there is no class loader leak, but we are getting permgen errors (and even if there is, this question is orthogonal to any potential leak).
Is there any way of specifying that certain ClassLoaders and their loaded classes are placed in the heap rather than in perm gen?
We are using the Oracle JDK Java 6 on Linux.
Edit: Looks like Java 8 will no longer have PermGen. It will be replaced by Metaspace.