Re: Memory usage from PID
Re: Memory usage from PID
- Subject: Re: Memory usage from PID
- From: Jens Alfke <email@hidden>
- Date: Wed, 16 Nov 2011 08:54:59 -0800
On Nov 16, 2011, at 8:45 AM, TomJones wrote:
> How would I go about getting an apps memory usage via a PID?
There’s a low-level API for getting info like this about processes. The standard response I’ve seen is “go to the darwin source archive and download the code for the top tool to see how to do it”.
Also, note that
(1) “Memory usage” is a really slippery term in a modern virtual-memory-based system. Are you talking about address space or physical RAM? Mapped or unmapped? Shared or exclusive? There are at least five different metrics related to memory and address space reported by top (RPRVT RSHRD RSIZE VPRVT VSIZE). You’re going to need to know what they mean and which of them are relevant to your needs.
(2) This is off-topic for cocoa-dev. Try darwin-userlevel instead if you have further questions.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden