In this article, we will discuss the pmap command in Linux, which provides a detailed view of the memory usage associated with a specific process.
It shows in extended format with the -x parameter.
Usage of the command; pmap -x PID
• First, the PID (process id) of the process must be found;
1 2 3 4 5 | $ pgrep -lf ora_ 15224 ora_pmon_taptest 15226 ora_psp0_taptest 15228 ora_mman_taptest 15230 ora_dbw0_taptest |
• Then, memory usage can be queried with pmap;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | $ pmap -x 15224 15224: ora_pmon_taptest Address Kbytes RSS Dirty Mode Mapping 0000000000400000 100412 7256 0 r-x-- oracle 000000000680f000 544 180 64 rwx-- oracle 0000000006897000 148 104 104 rwx-- [ anon ] 000000000f63f000 540 456 456 rwx-- [ anon ] 0000000060000000 6293504 2020 528 rwxs- [ shmid=0x308012 ] 0000003232200000 112 100 0 r-x-- ld-2.5.so 000000323241b000 4 4 4 r-x-- ld-2.5.so 000000323241c000 4 4 4 rwx-- ld-2.5.so 0000003232600000 4 4 0 r-x-- libaio.so.1.0.1 0000003232601000 2044 0 0 ----- libaio.so.1.0.1 0000003232800000 4 4 4 rwx-- libaio.so.1.0.1 0000003233200000 1336 484 0 r-x-- libc-2.5.so 000000323334e000 2044 0 0 ----- libc-2.5.so 000000323354d000 16 16 8 r-x-- libc-2.5.so 0000003233551000 4 4 4 rwx-- libc-2.5.so 0000003233552000 20 20 20 rwx-- [ anon ] 0000003233600000 520 64 0 r-x-- libm-2.5.so 0000003233682000 2044 0 0 ----- libm-2.5.so 0000003233881000 4 4 4 r-x-- libm-2.5.so 0000003233882000 4 4 4 rwx-- libm-2.5.so 0000003233a00000 8 8 0 r-x-- libdl-2.5.so 0000003233a02000 2048 0 0 ----- libdl-2.5.so 0000003233c02000 4 4 4 r-x-- libdl-2.5.so 0000003233c03000 4 4 4 rwx-- libdl-2.5.so 0000003233e00000 88 56 0 r-x-- libpthread-2.5.so 0000003233e16000 2044 0 0 ----- libpthread-2.5.so 0000003234015000 4 4 4 r-x-- libpthread-2.5.so 0000003234016000 4 4 4 rwx-- libpthread-2.5.so 0000003234017000 16 4 4 rwx-- [ anon ] 000000323c800000 84 24 0 r-x-- libnsl-2.5.so 000000323c815000 2044 0 0 ----- libnsl-2.5.so 000000323ca14000 4 4 4 r-x-- libnsl-2.5.so 000000323ca15000 4 4 4 rwx-- libnsl-2.5.so 000000323ca16000 8 0 0 rwx-- [ anon ] 00002aacf6dfa000 8 8 8 rwx-- [ anon ] 00002aacf6dfc000 164 56 16 r-x-- libskgxp10.so 00002aacf6e25000 1024 0 0 ----- libskgxp10.so 00002aacf6f25000 8 8 8 rwx-- libskgxp10.so 00002aacf6f27000 944 312 88 r-x-- libhasgen10.so 00002aacf7013000 1020 0 0 ----- libhasgen10.so 00002aacf7112000 28 28 28 rwx-- libhasgen10.so 00002aacf7119000 16 4 4 rwx-- [ anon ] 00002aacf711d000 8 8 4 r-x-- libskgxn2.so 00002aacf711f000 1020 0 0 ----- libskgxn2.so 00002aacf721e000 4 4 4 rwx-- libskgxn2.so 00002aacf721f000 4 4 4 rwx-- [ anon ] 00002aacf7220000 428 84 28 r-x-- libocr10.so 00002aacf728b000 1024 0 0 ----- libocr10.so 00002aacf738b000 8 8 8 rwx-- libocr10.so 00002aacf738d000 256 56 20 r-x-- libocrb10.so 00002aacf73cd000 1024 0 0 ----- libocrb10.so 00002aacf74cd000 4 4 4 rwx-- libocrb10.so 00002aacf74ce000 444 144 44 r-x-- libocrutl10.so 00002aacf753d000 1020 0 0 ----- libocrutl10.so 00002aacf763c000 20 20 20 rwx-- libocrutl10.so 00002aacf7641000 12 4 4 rwx-- [ anon ] 00002aacf7644000 8492 2928 0 r-x-- libjox10.so 00002aacf7e8f000 1020 0 0 ----- libjox10.so 00002aacf7f8e000 1568 1564 1564 rwx-- libjox10.so 00002aacf8116000 32 20 4 r-x-- libclsra10.so 00002aacf811e000 1024 0 0 ----- libclsra10.so 00002aacf821e000 4 4 4 rwx-- libclsra10.so 00002aacf821f000 112 32 8 r-x-- libdbcfg10.so 00002aacf823b000 1024 0 0 ----- libdbcfg10.so 00002aacf833b000 8 8 8 rwx-- libdbcfg10.so 00002aacf833d000 4 4 4 rwx-- [ anon ] 00002aacf833e000 3004 1196 416 r-x-- libnnz10.so 00002aacf862d000 1020 0 0 ----- libnnz10.so 00002aacf872c000 708 256 256 rwx-- libnnz10.so 00002aacf87dd000 4 0 0 rwx-- [ anon ] 00002aacf8802000 1476 92 92 rwx-- [ anon ] 00002aacf8973000 4 4 0 rwxs- hc_taptest.dat 00002aacf897a000 88 88 12 rwx-- zero 00002aacf8990000 64 64 12 rwx-- zero 00002aacf89a0000 64 64 48 rwx-- zero 00002aacf89b0000 64 64 64 rwx-- zero 00002aacf89c0000 64 64 16 rwx-- zero 00002aacf89d0000 168 168 0 rwx-- zero 00002aacf89fa000 132 4 4 rwx-- [ anon ] 00002aacf8a1e000 40 28 0 r-x-- libnss_files-2.5.so 00002aacf8a28000 2044 0 0 ----- libnss_files-2.5.so 00002aacf8c27000 4 4 4 r-x-- libnss_files-2.5.so 00002aacf8c28000 4 4 4 rwx-- libnss_files-2.5.so 00002aacf8c29000 912 20 20 rwx-- [ anon ] 00007fff72f0b000 84 24 24 rwx-- [ stack ] ffffffffff600000 8192 0 0 ----- [ anon ] ---------------- ------ ------ ------ total kB 6449592 18300 4088 |