联系:手机/微信(+86 17813235971) QQ(107644445)
标题:aix中procmap 查看oracle进程占用系统内存
作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]
procmap是用来显示进程地址空间,通过这个命令找出来的“read/write”表示为进程的私有内存,如果对应到oracle 进程的LOCAL中来,也就是对应了是oracle 会话进程占用的操作系统内存,和sga与pga无关,即ORACLE数据库进程占用的额外的系统内存,在计算oracle数据库消耗内存的时候,要考虑sga+pga+process占用的内存
procmap命令使用
$procmap 7931354 7931354 : oracleccicdx (LOCAL=NO) 100000000 95504K read/exec oracle 110000035 2399K read/write oracle 9fffffff0000000 51K read/exec /usr/ccs/bin/usla64 9fffffff000cfe2 0K read/write /usr/ccs/bin/usla64 900000000b05930 2K read/exec /usr/lib/libC.a[shr3_64.o] 9001000a0122930 0K read/write /usr/lib/libC.a[shr3_64.o] 900000000ae6b00 118K read/exec /usr/lib/libC.a[shrcore_64.o] 9001000a030a100 12K read/write /usr/lib/libC.a[shrcore_64.o] 900000000ac8000 118K read/exec /usr/lib/libC.a[ansicore_64.o] 9001000a0300e00 36K read/write /usr/lib/libC.a[ansicore_64.o] 900000000411468 0K read/exec /usr/lib/libicudata.a[shr_64.o] 9001000a0121468 0K read/write /usr/lib/libicudata.a[shr_64.o] 90000000040f738 2K read/exec /usr/lib/libC.a[shr2_64.o] 9001000a0314738 0K read/write /usr/lib/libC.a[shr2_64.o] 9000000008dd800 1699K read/exec /usr/lib/libC.a[ansi_64.o] 9001000a0315a00 277K read/write /usr/lib/libC.a[ansi_64.o] 9000000008bab00 135K read/exec /usr/lib/libC.a[shr_64.o] 9001000a030eb00 19K read/write /usr/lib/libC.a[shr_64.o] 900000000708180 1732K read/exec /usr/lib/libicuuc.a[shr_64.o] 9001000a035cdac 180K read/write /usr/lib/libicuuc.a[shr_64.o] 900000000493d80 2510K read/exec /usr/lib/libicui18n.a[shr_64.o] 9001000a038a148 270K read/write /usr/lib/libicui18n.a[shr_64.o] 900000000473200 91K read/exec /usr/lib/libsrc.a[shr_64.o] 9001000a01127a8 55K read/write /usr/lib/libsrc.a[shr_64.o] 90000000045a300 98K read/exec /usr/lib/libcorcfg.a[shr_64.o] 9001000a04147c8 18K read/write /usr/lib/libcorcfg.a[shr_64.o] 900000000b16200 750K read/exec /usr/lib/liblvm.a[shr_64.o] 9001000a03dd028 219K read/write /usr/lib/liblvm.a[shr_64.o] 900000000444f00 82K read/exec /usr/lib/libcfg.a[shr_64.o] 9001000a03d58f0 26K read/write /usr/lib/libcfg.a[shr_64.o] 90000000040e3a0 2K read/exec /usr/lib/libcrypt.a[shr_64.o] 9001000a0106948 0K read/write /usr/lib/libcrypt.a[shr_64.o] 90000001615d860 5K read/exec /usr/lib/libc.a[aio_64.o] 9001000a3aed568 0K read/write /usr/lib/libc.a[aio_64.o] 9000000003efc00 120K read/exec /usr/lib/libodm.a[shr_64.o] 9001000a0107cc8 40K read/write /usr/lib/libodm.a[shr_64.o] 900000000bd2c80 147K read/exec /usr/lib/libperfstat.a[shr_64.o] 9001000a041a960 14K read/write /usr/lib/libperfstat.a[shr_64.o] 9000000017d7000 0K read/exec /usr/lib/libdl.a[shr_64.o] 9001000a0517000 0K read/write /usr/lib/libdl.a[shr_64.o] 9000000158ed100 8636K read/exec /oracle/product/db10gr2/lib/libjox10.a[shr.o] 8001000a0000b78 587K read/write /oracle/product/db10gr2/lib/libjox10.a[shr.o] 900000000a87000 257K read/exec /usr/lib/libpthreads.a[shr_xpg5_64.o] 9001000a0274000 559K read/write /usr/lib/libpthreads.a[shr_xpg5_64.o] 900000000000800 4025K read/exec /usr/lib/libc.a[shr_64.o] 9001000a0000020 1047K read/write /usr/lib/libc.a[shr_64.o] Total 121863K
简化命令,统计私有内存,procmap 7931354|grep “read/write” |awk -F ” ” ‘{print $2}’,通过相关计算的出来,在当前的操作系统和数据库版本中,一个LOCAL=NO进程占用系统内存为:5758KB
补充说明
1.操作系统版本
$oslevel -r 6100-06
2.数据库版本
SQL> select * from v$version; BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi PL/SQL Release 10.2.0.4.0 - Production CORE 10.2.0.4.0 Production TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio NLSRTL Version 10.2.0.4.0 - Production
3.通过跟踪多个LOCAL=NO进程,发现类似进程占用的系统内存相同,估算给系统oracle进程占用的内存,可以通过该值进行大概估算
4.确认ORACLE使用的内存量不是以往认识的sga+pga,实际上应该是sga+pga+所有oracle进程占用
5.在linux中使用pmap来查看
Linux下也可以使用/proc的,而且还可以看swap的使用量
cat /proc/2934/status
Name: orarootagent.bi
State: S (sleeping)
Tgid: 2934
Pid: 2934
PPid: 1
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
Utrace: 0
FDSize: 1024
Groups: 0 1 2 3 4 6 10
VmPeak: 1669572 kB
VmSize: 1669568 kB
VmLck: 0 kB
VmHWM: 36792 kB
VmRSS: 27732 kB
VmData: 1567920 kB
VmStk: 148 kB
VmExe: 5516 kB
VmLib: 56740 kB
VmPTE: 444 kB
VmSwap: 6636 kB
Threads: 22
SigQ: 8/30454
SigPnd: 0000000000000000
ShdPnd: 0000000000010000
SigBlk: 0000000000010000
SigIgn: 0000000000381007
SigCgt: 0000000180004468
CapInh: 0000000000000000
CapPrm: ffffffffffffffff
CapEff: ffffffffffffffff
CapBnd: ffffffffffffffff
Cpus_allowed: ffffffff,ffffffff
Cpus_allowed_list: 0-63
Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
Mems_allowed_list: 0
voluntary_ctxt_switches: 36474
nonvoluntary_ctxt_switches: 2531
你确定:5758KB大小的内存是除sga和pga之外进程占用的内存吗?这样的话是不是有点多?我觉得应该是除sga之外占用的内存。