How to calculate application memory and cache memory like Activity Monitor in object C in Mac?
I am trying to write a MAC OSX system monitoring program (something similar to an activity monitor). I am using vm_statistics64_data_t to get "free_count, active_count, inactive_count" etc.
But I can't figure out the app memory correctly. I used
"vm_page_size * vmStats.internal_page_count"
to compute application memory, but it is out of sync with Activity Monitor.
+3
source to share