Process memory map
Each running process in user space has a process map that we can inspect. These memory maps tell us how a program’s memory is allocated and what shared libraries it is linked to. You can see the memory map for a process through the proc
filesystem. Here is the map for the init
process (PID 1):
# cat /proc/1/maps
aaaaaf830000-aaaaaf83a000 r-xp 00000000 b3:62 397 /sbin/init.sysvinit
aaaaaf84f000-aaaaaf850000 r--p 0000f000 b3:62 397 /sbin/init.sysvinit
aaaaaf850000-aaaaaf851000 rw-p 00010000 b3:62 397 /sbin/init.sysvinit
aaaae9d63000-aaaae9d84000 rw-p 00000000 00:00 0 [heap]
ffff7ffb0000-ffff8013b000 r-xp 00000000 b3:62 309 /lib/libc.so.6
ffff8013b000-ffff8014d000 ---p 0018b000 b3:62 309 /lib/libc.so.6
ffff8014d000-ffff80150000 r--p 0018d000 b3:62 309 /lib/libc.so.6
ffff80150000-ffff80152000 rw-p 00190000 b3:62 309 /lib/libc.so.6
ffff80152000-ffff8015e000 rw-p 00000000 00:00 0
ffff8016c000-ffff80193000 r-xp 00000000 b3:62 304 /lib/ld...