The amount of memory mapped into that process' address space. This can include shared memory mappings.
In a process there will be sections of the memory space for each shared object (DLL) that is part of it, as well as some memory for stack, and areas allocated by the process itself.
For example looking at the memory map of a cat
command on my system I can see its memory mappings. In this case I use cat /proc/self/maps
to investigate the cat process itself. Mapped into its virtual memory is the binary itself, some heap, locale information, libc (with various permission flags), ld.so (the dynamic linker), stack, vdso and vsyscall sections and some anonymous mappings (mapped pages with no backing file).
00400000-00408000 r-xp /bin/cat
00607000-00608000 rw-p /bin/cat
008ac000-008cd000 rw-p [heap]
7fbd54175000-7fbd543cf000 r--p /usr/lib/locale/locale-archive
7fbd543cf000-7fbd54519000 r-xp /lib/libc-2.7.so
7fbd54519000-7fbd54718000 ---p /lib/libc-2.7.so
7fbd54718000-7fbd5471b000 r--p /lib/libc-2.7.so
7fbd5471b000-7fbd5471d000 rw-p /lib/libc-2.7.so
7fbd5471d000-7fbd54722000 rw-p
7fbd54722000-7fbd5473e000 r-xp /lib/ld-2.7.so
7fbd5491d000-7fbd5491f000 rw-p
7fbd5493a000-7fbd5493d000 rw-p
7fbd5493d000-7fbd5493f000 rw-p /lib/ld-2.7.so
7fff5c929000-7fff5c93e000 rw-p [stack]
7fff5c9fe000-7fff5c9ff000 r-xp [vdso]
ffffffffff600000-ffffffffff601000 r-xp [vsyscall]
For each mapping, subtract the start address from the end address to determine its size, for example the [stack]
line: 0x7fff5c9ff000 - 0x7fff5c9fe000 = 0x1000
. In decimal, 4096 bytes - a 4 kiB stack.
If you add up all these figures, you'll get the process' virtual memory (VM) size.
VM size is not a reliable way to determine how much memory a process is using. For instance there will only be one copy of each of the read-only /lib/libc-2.7.so
maps in physical memory, regardless of how many processes use it.