Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is heap virtual?

 
kumm redd
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
newbie in java

what i understood about the runtime of java class is

when i run my prog
java xxx

1. The JVM is loaded into RAM?
2. The classXXX and its dependent classes are loaded by JVM into the RAM ?
3. The objects created by class reside in <b>Heap</b>

where is this Heap actually, is it a virtual memory in RAM created by JVM? or is this physical?

please clarify me..thank you
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to Bruce Eckel's Thinking in Java, the heap is in RAM.

See the topic, "Where storage lives" in Chapter 2 (reference below). This briefly describes registers, the stack, the heap, static storage, constant storage, and non-RAM storage.

Ref: http://www.faqs.org/docs/think_java/TIJ304.htm
[ December 02, 2004: Message edited by: marc weber ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kumred,

Welcome to JavaRanch!

We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.

We request that display names follow the pattern FIRST_NAME + SPACE + LAST_NAME.

Thanks Pardner! Hope to see you 'round the Ranch!
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where is this Heap actually, is it a virtual memory in RAM created by JVM? or is this physical?

When the JVM is started, it's loaded by an operating system into system memory (RAM). The operating system manages the system memory, including determing whether to put the memory where the JVM is executing in physical memory or in virtual memory. The JVM doesn't manage this.

Any decent book on operating system concepts should cover memory management in more detail.

The "Heap" memory used by the JVM is part of the total memory the operating system allocates to the JVM. The JVM does manage what data is in the "Heap", but it has no control over whether this section of "Heap" memory is in physical memory or in virtual memory.
 
kumm redd
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
thank you for ur replies..

few books say that java heap is created by JVM(i.e, after jvm is loaded, heap memory is allocated my jvm ), and few say that heap is a part of memory in RAM allocated to JVM by OS.

and dirk, changed my display name..

thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic