观察数据库发现,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 对应的映像文件名