File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Heap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Heap" Watch "Heap" New topic


pradeepta chopra
Ranch Hand

Joined: Jul 05, 2008
Posts: 137
why the name heap for memory storing objects??
is it only a virtual heap which refers to a chunk of memory or has it anything to do with the heap-the data structure??
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 36464
As far as I know the first.
Mandar Khire
Ranch Hand

Joined: Sep 11, 2007
Posts: 485
why the name heap for memory storing objects?

First understand meaning of word Heap:- A group of things placed or thrown, one on top of the other.
memory is allocated from a large pool of unused memory area called the heap (also called the free store).
Heap Memory is a area in main memory that is used to assign dynamically allocated memory to a application. Heap is generally managed in the form of linked list and in most os allocation or delocation can be done on per byte basis or in some cases it may be 4 bytes ; since OS mostly use paged memory management so an internal fault is found. Heap memory can be manged in non movable or movable blocks which again depends on os implementations.
heap can be local as well as global ie shared among many processes. But if your process does frequent allocation and deallocation of memory it is advisable to have local heap associated with that process only...
Read following links
[Dynamic memory allocation]
[heap memory pdf book]
[For diagram of heap memory]
[How IBM use heap memory]
[Same question ask in other forum]
is it only a virtual heap which refers to a chunk of memory

Read for
Chunk of memory.

Millions saw the apple fall, but Newton asked why.
If you understand, say "understand". If you don't understand, say "don't understand". But if you understand and say "don't understand". How do I understand that you understand? Understand!
pradeepta chopra
Ranch Hand

Joined: Jul 05, 2008
Posts: 137
I agree. Here's the link:
subject: Heap
Similar Threads
When will a variable use memory from stack and when will use memory from heap?
Can a object contain another object?
JVM memory management
Pool of Interns Memory(String literals)
BufferedReader input file size limit