How to find the starting and ending address of Heap memory for a program? How to find the starting and ending address of Heap memory for a program? unix unix

How to find the starting and ending address of Heap memory for a program?


On Linux you can open file /proc/self/maps,for example with fopen, and read it until you find linelike this:

0060f000-00630000 rw-p 00000000 00:00 0 [heap]

0060f000-00630000 - address range of heap