I need to know how much memory used by process in linux. I used
FILE* file = fopen("/proc/self/maps", "r");
I read like this :
5606ee35c000-5606ee37d000 rw-p 00000000 00:00 0 [heap]
7fff502d9000-7fff502fa000 rw-p 00000000 00:00 0 [stack]
I have calculated memory map with this output like this:
Heap Size:135168
Heap Start Address: 5606ee35c000
Heap Finish Address:5606ee37d000
Stack Size:135168
Stack Start Address: 7fff502d9000
Stack Finish Address:7fff502fa000
But I used 10 byte stack(in function) and 50 byte heap(with malloc) in code. Why it shows 135168 byte. Can anybody help me?