In the Sun JVM, classes that are loaded by the class loader are put in permgen space and never gc'd. (Unless the class loader goes out of scope) It's my understanding that JRockit puts that same data on the heap instead. Is that data then subject to garbage collection?
Thanks.
The problem has nothing to do with where the classes get allocated. The problem is that classloaders always keep references to their classes, which means that classes cannot be garbage collected unless and until their classloader gets garbage collected.
This problem is just more obvious on HotSpot, because PermGen memory is scarce and expensive.