• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

permanent memory???

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is there any concept of permanent memory ??? as far as i know there are two memory areas as explained in head first java ..... Heap and Stack

but i read somewhere that when we execute any class it gets loaded in permanent memory , first all functions are loaded .

i am totally confused about it please can anyone explain me what all happens in memory ,for my simple program as written below???


class Emp
{
String name;
int salary;
void get(String s1,int s2)
{
name=s1;
salary=s2;
}

void show()
{
System.out.println(name);
System.out.println(salary);
}

public static void main(String [] arg){
Emp e=new Emp();
e.get("mine", 2000);
e.show();
}
}
will get() , show() and main() load in something called permanent memory ???
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The "permanent generation" is the area of memory where things very unlikely to be deleted by the garbage collector are loaded. This includes String literals (i.e., "the String pool" you may have heard of) and objects that represent individual classes, including their code. The permanent generation is just part of the heap, and it's not really "permanent" -- when the JVM exits, it disappears. Perhaps it should really be "the long-lasting generation", or some such.

This is a rather advanced topic, and it's neither something you should worry about, nor something that could easily be explained in detail until you've developed some more fundamental knowledge about the JVM itself.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ernest Friedman-Hill wrote: . . . more fundamental knowledge about the JVM itself.

Look in the Bytecode Engineering Laboratory website and look for the manual.
 
suavedeep kaur
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
still not getting the point???
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As EFH has already told you, it is something you can get away without knowing. He has told you all you need to know.
 
reply
    Bookmark Topic Watch Topic
  • New Topic