Calculating physical footprint vs SM_PRIVATE regions

Questions and Answers about all things *OS (macOS, iOS, tvOS, watchOS)

Calculating physical footprint vs SM_PRIVATE regions

Postby elist » Wed Jun 27, 2018 4:17 pm

Hi J!

I am working on a system resources monitor tool for iOS, and had trouble understanding something APPL are doing. Hoped you'd have an insight on that...
I use mach_vm_region in a simple application and sum up the region's memory based on the sm_mode.
The SM_PRIVATE regions sum up to roughly 550MB.
The thing is, I would expect it to be much smaller, since the app is doing virtually no allocations...
I don't believe these regions are from shared caches, since it would probably not be in SM_PRIVATE but in SM_COW or SM_SHARED.

So I looked into APPL's implementation of Instruments, and found that the instruments service (DTSysmonTap or something) is serving a value attributed "physFootprint", which is what Instruments presents in the "Memory" column of the activity monitor - this value is a few MBs and makes much more sense to me.

Problem is, I don't understand how this value is calculated... I will try to dig into the daemon itself later, but was hoping to get a hint from someone more familiar with iOS's vm model...

I was guessing that the SM_PRIVATE includes the pools for objc object allocator, but could not verify this, and I also have no idea how to get the same value from inside the process.

So.. the question is actually - any idea what is the term "Physical Footprint"? Is it a common term that I can learn about somewhere?

Thanks in advance!
elist
 
Posts: 19
Joined: Wed Mar 16, 2016 9:05 am

Re: Calculating physical footprint vs SM_PRIVATE regions

Postby morpheus » Wed Aug 15, 2018 12:31 am

And I just saw this now. You get that from proc_info syscall. That also shows you the implementation in kernel mode (bsd/kern/proc_info.c). ProcExp reports the same value IIRC.
morpheus
Site Admin
 
Posts: 705
Joined: Thu Apr 11, 2013 6:24 pm


Return to Questions and Answers

Who is online

Users browsing this forum: No registered users and 5 guests