How to find out memory layout of your data structure implementation on Linux 64bit machine

Posted by ajay on Stack Overflow See other posts from Stack Overflow or by ajay
Published on 2014-08-24T22:17:16Z Indexed on 2014/08/24 22:19 UTC
Read the original article Hit count: 509

In this article, http://cacm.acm.org/magazines/2010/7/95061-youre-doing-it-wrong/fulltext

the author talks about the memory layouts of 2 data structures - The Binary Heap and the B-Heap and compares how one has better memory layout than the other.

http://deliveryimages.acm.org/10.1145/1790000/1785434/figs/f5.jpg

http://deliveryimages.acm.org/10.1145/1790000/1785434/figs/f6.jpg

I want to get hands on experience on this. I have an implementation of a N-Ary Tree and I want to find out the memory layout of my data structure. What is the best way to come up with a memory layout like the one in the article?

Secondly, I think it is easier to identify the memory layout if it is an array based implementation. If the implementation of a Tree uses pointers then what Tools do we have or what kind of approach is required to map it's memory layout?

Thanks!

© Stack Overflow or respective owner

Related posts about linux

Related posts about data-structures