[dtrace-discuss] Getting total memory allocated so far

Jim Mauro
Fri, 04 Jan 2008 19:09:08 -0000

Thanks for the update. You probably already know this,
but...
>
> 2. I''m trying to track the memory allocations/frees relative to
> specific events in the code (e.g. someone getting hit by a projectile,
> etc).  The granularity for this stuff is pretty tight.  Some state
> variables linked to the place in the code where the program is (single
> threaded) when the malloc/free occurs tells me a lot.  Makes it easy
> to tell which portions of the program are responsible for most of the
> memory allocations.
Grabbing a ustack() in the pid<PID>:libc:malloc:entry and
pid<PID>:libc:free:entry
probes is your friend here...

Thanks,
/jim