• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

permanent memory???

 
suavedeep kaur
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • 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 ???
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50196
79
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
still not getting the point???
 
Campbell Ritchie
Sheriff
Pie
Posts: 50196
79
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic