This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes about permanent generation ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "about permanent generation ?" Watch "about permanent generation ?" New topic
Author

about permanent generation ?

Anto Telvin
Ranch Hand

Joined: Aug 12, 2008
Posts: 113
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
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi there,

I think you are referring to Perm Gen yes? See this discussion.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Anto Telvin
Ranch Hand

Joined: Aug 12, 2008
Posts: 113
hi

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
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18509
    
  40

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?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Anto Telvin
Ranch Hand

Joined: Aug 12, 2008
Posts: 113
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 ?
 
jQuery in Action, 2nd edition
 
subject: about permanent generation ?
 
Similar Threads
where final and static variable stored?
Regarding JVM options with Heap size and PermGenSpace
Interview q
String Object query
static variables