Is there any API for the command vmmap

后端 未结 1 1536
误落风尘
误落风尘 2021-01-23 07:07

In the command line, i can use vmmap -v -purge 50554 to find the memory information of the process 50554, and get the output like below:

                    


        
相关标签:
1条回答
  • 2021-01-23 07:27

    The answer to your question is somewhat complex, but can be found in the kernel source code for mach_vm_region_info(): https://opensource.apple.com/source/xnu/xnu-201/osfmk/vm/vm_debug.c

    This code (among other things) runs through the VM map table and builds a linked list of structures which contain all of the info displayed by the vmmap(1) command.

    0 讨论(0)
提交回复
热议问题