Instead of using instrumentation, is there a way to get current consumption? I want to periodically log the memory consumption (or how much free memory I got).
views:
40answers:
1
A:
#include <mach/task.h>
#include <mach/task_info.h>
task_basic_info basic;
mach_msg_type_number_t count = TASK_BASIC_INFO_COUNT;
task_info( mach_task_self() , TASK_BASIC_INFO , (task_info_t)&basic , &count );
I have not tried this on an iPhone. There may be permission issues when running in a sandbox.
drawnonward
2010-06-23 08:48:45
thanks that worked.
BuggerMe
2010-06-24 01:08:23