联系:手机/微信(+86 17813235971) QQ(107644445)
标题:Linux之pmap命令
作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]
观察数据库发现,ora_dbw进程占用内存非常高,感觉很奇怪,然后询问高手,通过pmap命令发现,该进程是几乎具有了整个sga的句柄,所以显示占用的内存非常大,其实自己私有的很小
[oracle@DB1 ~]$ top -c
top – 23:06:02 up 553 days, 21:46, 1 user, load average: 0.62, 0.58, 0.47
Tasks: 365 total, 1 running, 364 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.7%us, 0.3%sy, 0.0%ni, 98.3%id, 0.5%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 24666528k total, 24504356k used, 162172k free, 9192k buffers
Swap: 24579440k total, 3864056k used, 20715384k free, 18728188k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2270 oracle 15 -1 20.1g 1.1g 1.1g S 2.7 4.7 147:10.01 oracleora9i (LOCAL=NO)
4334 oracle 14 -1 20.1g 1.7g 1.7g S 1.3 7.4 3:08.38 oracleora9i (LOCAL=NO)
5491 oracle 15 -1 20.2g 14g 14g S 1.3 62.1 699:54.55 ora_dbw1_ora9i
9682 oracle 15 0 12868 1296 820 R 1.3 0.0 0:00.14 top -c
18552 oracle 14 -1 20.1g 1.7g 1.7g S 1.3 7.2 2:43.74 oracleora9i (LOCAL=NO)
29977 oracle 14 -1 20.1g 2.1g 2.1g S 1.3 9.1 4:50.87 oracleora9i (LOCAL=NO)
SQL> show parameter sga;
NAME TYPE VALUE
———————————— ———– ——————————
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 20G
sga_target big integer 20G
[oracle@DB1 ~]$ pmap
Usage: pmap [-x | -d] [-q] pid…
-x show details
-d show offset and device number
-q quiet; less header/footer info
-V show the version number
[oracle@DB1 ~]$ pmap -d 5491
5491: ora_dbw1_ora9i
Address Kbytes Mode Offset Device Mapping
0000000000400000 100412 r-x– 0000000000000000 008:00005 oracle
000000000680f000 544 rwx– 000000000620f000 008:00005 oracle
0000000006897000 148 rwx– 0000000006897000 000:00000 [ anon ]
000000001f2f7000 596 rwx– 000000001f2f7000 000:00000 [ anon ]
0000000060000000 20971520 rwxs- 0000000000000000 000:00009 [ shmid=0x0 ]
0000000580000000 2048 rwxs- 0000000000000000 000:00009 [ shmid=0x8001 ]
0000003b44a00000 112 r-x– 0000000000000000 008:00001 ld-2.5.so
……
00002b293c72b000 64 rwx– 0000000000000000 000:00011 zero
00002b293c73b000 64 rwx– 0000000000000000 000:00011 zero
00002b293c74b000 64 rwx– 0000000000000000 000:00011 zero
00002b293c75b000 3840 —– 0000000000b2a000 000:00011 zero
00007fff710f7000 84 rwx– 00007ffffffea000 000:00000 [ stack ]
ffffffffff600000 8192 —– 0000000000000000 000:00000 [ anon ]
mapped: 21145976K writeable/private: 19316K shared: 20973572K
[oracle@DB1 ~]$ pmap -x 5491
5491: ora_dbw1_ora9i
Address Kbytes RSS Anon Locked Mode Mapping
0000000000400000 100412 – – – r-x– oracle
000000000680f000 544 – – – rwx– oracle
0000000006897000 148 – – – rwx– [ anon ]
000000001f2f7000 596 – – – rwx– [ anon ]
0000000060000000 20971520 – – – rwxs- [ shmid=0x0 ]
0000000580000000 2048 – – – rwxs- [ shmid=0x8001 ]
……
00002b293c73b000 64 – – – rwx– zero
00002b293c74b000 64 – – – rwx– zero
00002b293c75b000 3840 – – – —– zero
00007fff710f7000 84 – – – rwx– [ stack ]
ffffffffff600000 8192 – – – —– [ anon ]
—————- —— —— —— ——
total kB 21145976 – – –
Address:进程所占的地址空间
Kbytes 该虚拟段的大小
RSS 设备号(主设备:次设备)
Anon 设备的节点号,0表示没有节点与内存相对应
Locked 是否允许swapped
Mode 权限:r=read, w=write, x=execute, s=shared, p=private(copy on write)
Mapping: bash 对应的映像文件名
为什么share那项数值那么大?查了好多资料,一直不理解share是什么?
您好,我也遇到了这样的问题,ra_dbw进程占用内存非常高,top命令显示出来的MEm分配率也特别高;
Tasks: 1174 total, 1 running, 1173 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.6%us, 0.4%sy, 0.0%ni, 99.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 57813980k total, 54527544k used, 3286436k free, 155016k buffers
Swap: 131074324k total, 9934412k used, 121139912k free, 44955880k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1849 oracle 20 0 19.2g 13g 13g S 0.0 24.6 4:34.56 ora_dbw7_hhtrep1
1847 oracle 20 0 19.2g 12g 12g S 0.0 23.1 4:14.40 ora_dbw6_hhtrep1
1835 oracle 20 0 19.2g 12g 12g S 0.0 22.9 4:28.66 ora_dbw0_hhtrep1
1837 oracle 20 0 19.2g 12g 12g S 0.0 22.5 4:11.95 ora_dbw1_hhtrep1
1845 oracle 20 0 19.2g 12g 12g S 0.0 22.2 4:02.48 ora_dbw5_hhtrep1
1841 oracle 20 0 19.2g 12g 12g S 0.0 21.9 4:03.43 ora_dbw3_hhtrep1
1839 oracle 20 0 19.2g 12g 12g S 0.0 21.9 4:03.49 ora_dbw2_hhtrep1
我通过您的方法用pmap命令做了分析:
[etl@hhtrep1 ~]$ pmap -d 1849
1849: ora_dbw7_hhtrep1
Address Kbytes Mode Offset Device Mapping
mapped: 0K writeable/private: 0K shared: 0K
[etl@hhtrep1 ~]$ pmap -x 1849
1849: ora_dbw7_hhtrep1
Address Kbytes RSS Dirty Mode Mapping
—————- —— —— ——
total kB 0 0 0
占用的内存都为0,现在我不知道该如何查下去了。
能否帮助解决我的疑惑。