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 is heap virtual? 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 "is heap virtual?" Watch "is heap virtual?" New topic
Author

is heap virtual?

kumm redd
Ranch Hand

Joined: Nov 02, 2004
Posts: 31
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

Joined: Aug 31, 2004
Posts: 11343

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 ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
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!


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
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

Joined: Nov 02, 2004
Posts: 31
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is heap virtual?
 
Similar Threads
nodes in stack
Java and Heap ADT
checking the instance of a class
Difference b/w Heap and Pool
Heap & Pool