[dtrace-discuss] Getting total memory allocated so far

Jeremy Harris
Wed, 02 Jan 2008 19:35:23 -0000

Lally Singh wrote:
> So really, just how much memory the app''s using via malloc/free
right now.

You should bear in mind that Unices traditionally support malloc/free
library calls with a "brk" or "sbrk" syscall and, for
efficiency,
the tracking is not exact.  In fact it is common to *never* release
memory to the kernel via the syscall - only by the process exit or exec.

So while tracking what you ask is possible, it might not be what you want.

Cheers,
   Jeremy