File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How do Java Heap looks like? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How do Java Heap looks like?" Watch "How do Java Heap looks like?" New topic
Author

How do Java Heap looks like?

Don Redd
Ranch Hand

Joined: Jan 05, 2012
Posts: 82

Hi ,

From the time,I started working on Java. I am hearing about objects residing on heap,heap partitions, heap sizes,Garbage Collectors and etc etc.

But, it is still not clear to me about, How objects are structured like heap( heap is data structure which maintains some ordering ),In what order the objects are arranged,Why only heap and why not any other data structure,what benefits do heap gives?



Regards,
Don..
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1836
    
    7

The memory pool referred to as "the heap" is not the same thing as the data structure that shares the same name.
The process of allocating memory is totally different from adding an object to a heap collection (tree-based).

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 905
    
    5
Heap (data structure)
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8427
    
  23

Don Redd wrote:But, it is still not clear to me about, How objects are structured like heap( heap is data structure which maintains some ordering ),In what order the objects are arranged,Why only heap and why not any other data structure,what benefits do heap gives?

You're being too literal. According to this page, which cites Donald Knuth:
'Several authors began about 1975 to call the pool of available memory a "heap."'

It has nothing to do with a Heap, although it's possible that the latter could be used for maintaining things such a freelists.

I'd also suggest that this sort of study is not really a good use of your time. Java is a memory-managed language, which means that you rarely, if ever, need to concern yourself with it; but if you really feel you must, knock yourself out. There's enough to know to keep yourself occupied for the next couple of years.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Don Redd
Ranch Hand

Joined: Jan 05, 2012
Posts: 82

Thanks Winston,For your suggestion...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do Java Heap looks like?