Is there any way to find the starting and ending address of heap memory.
#include<stdio.h>
void main()
{
printf("Ending address of Heap: %x\n",sbrk(0));
}
The above coding shows the ending address of heap memory. Like that is there any way to find the starting address of heap.
Output:
Ending address of Heap: 8556000
On Linux you can open file /proc/self/maps, for example with fopen, and read it until you find line like this:
0060f000-00630000 rw-p 00000000 00:00 0 [heap]
0060f000-00630000 - address range of heap
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With