views:

46

answers:

1

I have read somewhere that Perm gen space is not garbage collected. But in CMS collection I can see some classes unloading log. So does perm gen space is grabage collected in case of full collection or CMS collection.

+2  A: 

The PermGen is garbage collected like the other parts of the heap. The thing to note here is that the PermGen contains meta-data of the classes and the objects i.e. pointers into the rest of the heap where the objects are allocated. The PermGen also contains Class-loaders which have to be manually destroyed at the end of their use else they stay in memory and also keep holding references to their objects on the heap. Here is an article on the sun blog that might help you.

Sagar V