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开发者_如何学C?
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.
Another salient point though is that PermGen is often exhausted in Sun's whereby other JVMs may allocate in another not-so-limited space.
精彩评论