Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

To prevent the OOM killer running, I have set vm.overcommit_memory = 2 and vm.overcommit_ratio = 100 . I would like to know how much memory is committed by a given process, which is contributed to the commit count.

It is not the resident working set, since the resident working set does not include the amount swapped out. It is not the virtual size either, since the virtual size includes mmap()ed files, which do not contribute to the commit limit.

share|improve this question
    
Did you find a solution? –  ewwhite Dec 11 '12 at 21:06

2 Answers 2

Run pmap -x PID for the process's ID to show memory allocation.

[root@ObamaBiden ~]# pmap -x 8106
8106:   /opt/dbcfs/dbcfsrun 10.51.64.76 4483 /opt/dbcfs/dbcfs.cfg 9584:1 -ssl
Address           Kbytes     RSS   Dirty Mode   Mapping
0000000000266000     120      96       0 r-x--  ld-2.12.so
0000000000284000       4       4       4 r-x--  ld-2.12.so
0000000000285000       4       4       4 rwx--  ld-2.12.so
0000000000288000    1584     388       0 r-x--  libc-2.12.so
0000000000414000       8       8       8 r-x--  libc-2.12.so
0000000000416000       4       4       4 rwx--  libc-2.12.so
0000000000417000      12       8       8 rwx--    [ anon ]
0000000008048000     912     624       0 r-x--  dbcfsrun
000000000812c000      56      44      36 rwx--  dbcfsrun
000000000813a000     152      60      60 rwx--    [ anon ]
0000000008a51000     280     132     132 rwx--    [ anon ]
00000000f678c000   16008    5396    5396 rwx--    [ anon ]
00000000f7739000       4       4       4 rwx--    [ anon ]
00000000f773a000       4       4       0 r-x--    [ anon ]
00000000ffd8a000      84      32      32 rwx--    [ stack ]
----------------  ------  ------  ------
total kB           19236    6808    5688
share|improve this answer
1  
Your hostname has been recently upvoted :) –  pino42 Nov 7 '12 at 15:15

You can look at the cost map in the kernel documentation. In short, shared anonymous or /dev/zero maps count for their size just once, while private writable maps count once for each instance.

You can use pmap to look exactly at what a certain process is mapping and how. The output generated by pmap -d contains a footer line with the total aggregated size of private writable maps.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.