• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do Java Heap looks like?

 
Ranch Hand
Posts: 82
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Heap (data structure)
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Don Redd
Ranch Hand
Posts: 82
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Winston,For your suggestion...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic