Memory part 3: Virtual Memory
Posted Oct 11, 2007 23:32 UTC (Thu) by
jzbiciak (
✭ supporter ✭, #5246)
In reply to:
Memory part 3: Virtual Memory by addw
Parent article:
Memory part 3: Virtual Memory
If it were, then it seems virtual memory is a recipe for wasting half your memory. I think what was meant was "each contiguous range that is mapped."
There seems to be a shorthand amongst some folk to call what corresponds to a row in /proc/<PID>/maps "a mapping," when indeed it is typically composed of multiple pages, and is really multiple mappings that are contiguous in virtual address space. For example, a quick peek with "cat /proc/self/maps" here at work shows:
$ cat /proc/self/maps
00101000-00227000 r-xp 00000000 03:02 1196106 /lib/tls/libc-2.3.4.so
00227000-00229000 r-xp 00125000 03:02 1196106 /lib/tls/libc-2.3.4.so
00229000-0022b000 rwxp 00127000 03:02 1196106 /lib/tls/libc-2.3.4.so
0022b000-0022d000 rwxp 0022b000 00:00 0
0055c000-00572000 r-xp 00000000 03:02 1196104 /lib/ld-2.3.4.so
00572000-00573000 r-xp 00015000 03:02 1196104 /lib/ld-2.3.4.so
00573000-00574000 rwxp 00016000 03:02 1196104 /lib/ld-2.3.4.so
08048000-0804c000 r-xp 00000000 03:02 967851 /bin/cat
0804c000-0804d000 rwxp 00003000 03:02 967851 /bin/cat
0804d000-0806e000 rwxp 0804d000 00:00 0
b7fde000-b7fe0000 rwxp b7fde000 00:00 0
bfffd000-c0000000 rwxp bfffd000 00:00 0
ffffe000-fffff000 ---p 00000000 00:00 0
Under the shorthand nomenclature, that's 13 mappings. Clearly, far more than 13 pages are involved.
(
Log in to post comments)