Re: querying the system for RAM usage
Re: querying the system for RAM usage
- Subject: Re: querying the system for RAM usage
- From: Cameron Hayne <email@hidden>
- Date: Sat, 25 Jun 2005 23:53:03 -0400
On 25-Jun-05, at 11:05 PM, Brian Bergstrand wrote:
On Jun 25, 2005, at 5:49 PM, nick briggs wrote:
I am to querying the system for RAM usage by creating a NSTask to
'top' and parsing the output, are we aware of a more elegant
solution / API?
#import <mach/host_info.h>
#import <mach/mach_host.h>
#import <mach/host_priv.h>
vm_statistics_data_t page_info;
mach_msg_type_number_t count;
count = HOST_VM_INFO_COUNT;
kern_return_t kret = host_statistics (mach_host_self(),
HOST_VM_INFO, (host_info_t)&page_info, &count);
You can see an example of doing this in my "VMTester" project:
http://hayne.net/MacDev/VMTester/
--
Cameron Hayne
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden