When I cat /proc/1/smaps file I found that libs have often up to 4 mappings with different sizes and different Rss/Pss etc:7f1a09696000-7f1a0982f000 r-xp 00000000 fe:04 1313975                    /usr/lib/libc-2.21.soSize:               1636 kBRss:                 980 kBPss:                   9 kBShared_Clean:        980 kBShared_Dirty:          0 kBPrivate_Clean:         0 kBPrivate_Dirty:         0 kBReferenced:          980 kBAnonymous:             0 kBAnonHugePages:         0 kBSwap:                  0 kBKernelPageSize:        4 kBMMUPageSize:           4 kBLocked:                0 kBVmFlags: rd ex mr mw me 7f1a0982f000-7f1a09a2e000 ---p 00199000 fe:04 1313975                    /usr/lib/libc-2.21.soSize:               2044 kBRss:                   0 kBPss:                   0 kBShared_Clean:          0 kBShared_Dirty:          0 kBPrivate_Clean:         0 kBPrivate_Dirty:         0 kBReferenced:            0 kBAnonymous:             0 kBAnonHugePages:         0 kBSwap:                  0 kBKernelPageSize:        4 kBMMUPageSize:           4 kBLocked:                0 kBVmFlags: mr mw me 7f1a09a2e000-7f1a09a32000 r--p 00198000 fe:04 1313975                    /usr/lib/libc-2.21.soSize:                 16 kBRss:                  16 kBPss:                  14 kBShared_Clean:          0 kBShared_Dirty:          4 kBPrivate_Clean:        12 kBPrivate_Dirty:         0 kBReferenced:           12 kBAnonymous:            16 kBAnonHugePages:         0 kBSwap:                  0 kBKernelPageSize:        4 kBMMUPageSize:           4 kBLocked:                0 kBVmFlags: rd mr mw me ac 7f1a09a32000-7f1a09a34000 rw-p 0019c000 fe:04 1313975                    /usr/lib/libc-2.21.soSize:                  8 kBRss:                   8 kBPss:                   8 kBShared_Clean:          0 kBShared_Dirty:          0 kBPrivate_Clean:         0 kBPrivate_Dirty:         8 kBReferenced:            8 kBAnonymous:             8 kBAnonHugePages:         0 kBSwap:                  0 kBKernelPageSize:        4 kBMMUPageSize:           4 kBLocked:                0 kBVmFlags: rd wr mr mw me ac Can someone tell me why or point an article?
Why is one file listed sereval times in /proc/pid/smaps?
linux;proc
In general, libraries have three different types of memory that is loaded from the file. These are:code -- The actual executable code in the libraryrodata -- Read only data (constant values).data -- Writeable data.These are mapped with different permissions. If you look at the first line of each mapping:7f1a09696000-7f1a0982f000 r-xp 00000000 fe:04 1313975                    /usr/lib/libc-2.21.so7f1a0982f000-7f1a09a2e000 ---p 00199000 fe:04 1313975                    /usr/lib/libc-2.21.so7f1a09a2e000-7f1a09a32000 r--p 00198000 fe:04 1313975                    /usr/lib/libc-2.21.so7f1a09a32000-7f1a09a34000 rw-p 0019c000 fe:04 1313975                    /usr/lib/libc-2.21.soThe second column in the table contains the permissions for each mapped block. The first block has the permissions r-xp. This is the code block, and is therefore readable and executable.The second block has ---p. This block isn't accessible. It probably contains debugging symbols or some other data that isn't actually needed to execute the program.The third block has r--p. This is the read only data segment. The last block has rw-p. This is the writeable data segment.The reason for the different values of Rss and Pss, etc. is simply due to the different amounts of memory accessed in each region.If you are curious about the meanings of the various fields, take a look at the /proc/[pid]/smaps section in the proc man page. The header line for each section is documented in the /proc/[pid]/maps section.