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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to