Hi,
I am trying to get some metrics on process memory usage that I haven't been able to determine using the available APIs for macOS.
First, I'd like to learn how to obtain the Private memory size
property that Activity Monitor displays in the detailed information for a process. I haven't found anything like it using the proc_taskinfo()
or sysctl
APIs.
I also wonder about the relationship between the Private memory size
from Activity Monitor and the BYTES ALLOCATED
summary of vmmap
.
Second, I'd like to get the amount of virtual memory the process has reserved (Windows: "page file bytes").
Any hints would be greatly appreciated, as I have looked over all APIs and quite a bit of the XNU code without success! :-)