[Ilugc] Heap usage of a process

  • From: rsubr@xxxxxxxxxxxxxxxxxxxxxxxx (Raja Subramanian)
  • Date: Thu, 29 Jan 2004 08:38:26 +1100

Hi,

J.Mohamed Zahoor wrote:

Is there any way i can see the amount of HEAP a process is using...

If your program is coded using C/C++ you can override libc's malloc and
friends.  You typically don't even need to recompile your application.

You can find various "malloc debuggers" on freshmeat.net that will do
the job.

Note:  Some applications use their own internal implementation of
       malloc.  Eg.  For better performance, perl uses an internal
       version of malloc instead of the libc version.  You can never
       instrument such applications without modifying the source code.

Examining /proc will not help you much because it provides the kernel's
view of size/rss/share comes from brk().  This can be very different
from what your libc malloc is doing.

HTH,

- Raja


Other related posts: