How to get info about process memory mapping state on MAC OS Catalina

817 views Asked by At

I need to get info about process memory mapping state to find Memory Mapping Segment, Heap and Stack fragments.

On the Linux, command /proc/<PID>/maps show info about process memory mapping state. On the MAC I trying to use vmmap PID command, but I can not find information about Memory Mapping Segment, Heap and Stack fragments in the information that this command issues.

Information should be displayed in the following format:

556dfe8b6000-556dfe8bf000 rw-p 00107000 08:08 6553607 /bin/bash
556dfe8bf000-556dfe8c9000 rw-p 00000000 00:00 0
556dff36b000-556dff4e3000 rw-p 00000000 00:00 0 [heap]
7f558b5a3000-7f558b5a9000 rw-p 00000000 00:00 0
7f558cf3f000-7f558cf66000 r-xp 00000000 08:08 1577798 /lib/x86_64-linux-gnu/ld-2.27.so
...
7f558d168000-7f558d169000 rw-p 00000000 00:00 0
7ffe96b2c000-7ffe96b4d000 rw-p 00000000 00:00 0 [stack]
7ffe96b70000-7ffe96b73000 r--p 00000000 00:00 0 [vvar]
7ffe96b73000-7ffe96b75000 r-xp 00000000 00:00 0 [vdso]

For the instance I need to find: Heap - 556dff36b000-556dff4e3000, Stack - 7ffe96b2c000-7ffe96b4d000, MMS - 7f558b397000-7f558b3a2000.

1

There are 1 answers

0
Dmytro Holysh On

You could find Stack using this command:

vmmap [PID] | grep '[S|s]tack'

Heap is actually represented by bunch of MALLOC lines (MALLOC metadata, MALLOC guard page, etc...) link