[dtrace-discuss] Getting total memory allocated so far

Jim Mauro
Wed, 02 Jan 2008 15:44:48 -0000

Can you be more specific about "track memory usage"???
There''s a broad range of things that could fall into tracking memory
usage.
For example, if you''re just interested in tracking total physical
and/or
virtual
address space sizes, you can use prstat(1). If you''re interested in the
various
segments, you could take some pmap(1) samples from the target process
periodically.

What, precisely, would you like to track?

Thanks,
/jim


Lally Singh wrote:
> Hey all, I''ve been trying to track memory usage in an application.
> I''ve got probes into malloc() and free(), but I''d like to
just get a
> total allocated amount at any given time (as malloc & free only give
> me deltas, and buffer filling can make my running count worthless).
>
> Is there any probe for that?  This is on Solaris 10, and I can
> recompile the app as needed (but there are too many calls to malloc()
> to directly instrument them or what not).  Would libumem help with
> this?
>
> Thanks in advance!
>
> Btw, dtrace is a godsend.  Like a year less working on my PhD godsend.
>
>