Thank you wang zhe for a quick reply.
But my problem as like mentioned is to find out the exact used heap size of the user process instead of total allocated space.
in cat /proc/pid/mpas i am able to see that whenver a user process forks kernel allocating almost 33 page size of heap.But if the Process is having only few dynamic allocation it may be using only few KB heap.
So i just want to find out the exactly used heap not mm->brk or Vm->end of heap ,so that i can dump only that portion
if anyone knows please help
Thanks
Dhyan
2012/5/14 Dhyan <linuxdhyan@gmail.com>I am a kernelnewby and used to write a same kernel module.and hope to help you.Dear All,
I am writing a kernel module which will accept user process id (PID) as input and dump all the address space of that user process,like stack,heap segment.
I took mm->start_brk as start of heap ,mm->brk as end of heap,then i am seeing, even though user process is not using 33 pages heap size shows as 33 pages
(mm->brk -mm->start_brk) . (This i verified using /proc/pid/maps) .Stack also behaves in similar way,
So is there any way i can find out the really used heap staring from mm->start_brk,So that i can dump only the used heap
--
Thanks
Dhyan
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies