hi all i want to know what is permanent generation ? what is the use of it in java ? what all the things that can be stored in permannet generation ? It is a part of what?
Anto Telvin Mathew<br />Many of the life failures are people who did not realize how close they were to success when they give up. EDISON
in that link it is said that whatever classes are loading it will store in the permanent generation .but all the variables and methods are stored in heap /stack .why is it so ? why can't we store all the things in permanent generation .the entire class or just a class defenition is sored in permanent generation
Anto Telvin Mathew<br />Many of the life failures are people who did not realize how close they were to success when they give up. EDISON
Because variables and methods are things that typically fall out of scope and we want them to be garbage collected. Class definitions are something that can be 'sensibly' (YMMV) kept around permanently as they'll be referenced throughout the lifespan of the application.
The perm generation is an implementation detail of the heap. Some JVMs don't even have it -- as the objects just go into the tenured generation instead.
Developers are not supposed to know/care about this. It is the heap. Why do you care if it is in the young, old, or perm generation?
nope actually i encountered this question in an interview. that day only i came to know about that there is something called permanent generation. the actuall question is what is PG and what are inside that ?where static variables are going to store all these ?
Anto Telvin Mathew<br />Many of the life failures are people who did not realize how close they were to success when they give up. EDISON