[20210508]分析library cache轉儲 2.txt

lfree發表於2021-05-08

[20210508]分析library cache轉儲 2.txt

--//昨天分析library cache轉儲,連結http://blog.itpub.net/267265/viewspace-2771268/=>[20210507]分析library cache轉儲.txt
--//發現每個mutex佔用40位元組。不過我發現出現一些別的數值。今天再仔細探究看看。

1.環境:
SCOTT@book> @ ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

2.測試:
$ grep "Bucket:" book_ora_4308_0001.trc | sed "s/^Bucket: #=//;s/Mutex=//;s/(.*)//" > a3.txt

$ awk 'NR==1{a=$1;b=strtonum($2) } NR>1{ print (strtonum($2)-b)/($1-a);a=$1;b=strtonum($2)}'  a3.txt | sort | uniq -c | sort -nr
   3698 40
      1 -96675.8
      1 -943344
      1 -5246550
      1 -511229
      1 509576
      1 32856.1
      1 205413
      1 164322

--//可以發現大部分間隔都是40位元組。看看出現其它數值為什麼?

3.繼續:
$  awk 'NR==1{a=$1;b=strtonum($2);c=$2 } NR>1{ print a,c,$1,$2,(strtonum($2)-b)/($1-a);a=$1;b=strtonum($2);c=$2}'  a3.txt | grep -C 1 -v "40$"
40654 0x80bfdf88 40662 0x80bfe0c8 40
40662 0x80bfe0c8 40769 0x83ffdbb8 509576
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40769 0x83ffdbb8 40777 0x83ffdcf8 40
--
40910 0x83fff1c0 40947 0x83fff788 40
40947 0x83fff788 40998 0x847fd780 164322
++++++++++++++++++++++++++++++++++++++++
40998 0x847fd780 41014 0x847fda00 40
--
41187 0x847ff508 41215 0x847ff968 40
41215 0x847ff968 41223 0x81ff86b8 -5246550
##########################################
41223 0x81ff86b8 41240 0x81ff8960 40
--
41958 0x81fff990 41963 0x81fffa58 40
41963 0x81fffa58 42007 0x81bf1230 -96675.8
42007 0x81bf1230 42033 0x81bf1640 40
--
43472 0x81bff718 43516 0x81bffdf8 40
43516 0x81bffdf8 43542 0x80f52c50 -511229
43542 0x80f52c50 43545 0x80f52cc8 40
--
61058 0x80ffdd30 61087 0x80ffe1b8 40
61087 0x80ffe1b8 61210 0x813d8c10 32856.1
61210 0x813d8c10 61227 0x813d8eb8 40
--
65007 0x813fdd58 65013 0x813fde48 40
65013 0x813fde48 65031 0x81784960 205413
65031 0x81784960 65070 0x81784f78 40
--
77515 0x817fe800 77562 0x817fef58 40
77562 0x817fef58 77584 0x804342b0 -943344
77584 0x804342b0 77617 0x804347d8 40

SYS@book> @ fcha 0x80bfe0c8
Find in which heap (UGA, PGA or Shared Pool) the memory address 0x80bfe0c8 resides...

LOC KSMCHPTR           KSMCHIDX   KSMCHDUR KSMCHCOM           KSMCHSIZ KSMCHCLS   KSMCHTYP KSMCHPAR
--- ---------------- ---------- ---------- ---------------- ---------- -------- ---------- ----------------
SGA 0000000080834000          1          1 permanent memor     3974984 perm              0 00

SYS@book> @ fcha 0x83fff788
Find in which heap (UGA, PGA or Shared Pool) the memory address 0x83fff788 resides...

LOC KSMCHPTR           KSMCHIDX   KSMCHDUR KSMCHCOM           KSMCHSIZ KSMCHCLS   KSMCHTYP KSMCHPAR
--- ---------------- ---------- ---------- ---------------- ---------- -------- ---------- ----------------
SGA 0000000083FFD160          1          1 permanent memor       10272 perm              0 00

SYS@book> @ fcha 0x847ff968

LOC KSMCHPTR           KSMCHIDX   KSMCHDUR KSMCHCOM           KSMCHSIZ KSMCHCLS   KSMCHTYP KSMCHPAR
--- ---------------- ---------- ---------- ---------------- ---------- -------- ---------- ----------------
SGA 00000000847FD160          1          1 permanent memor       10272 perm              0 00

--//查詢下劃線,++++,####標識的chunk可以發現使用不同的chunk,這樣出現跳躍就正常的,很奇怪oracle為什麼不直接
--//分配完成的一個chunk放下整個這類的mutex。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2771276/,如需轉載,請註明出處,否則將追究法律責任。

相關文章