One sharedpool: heap/extent/chunk

Source: Internet
Author: User
This section describes the physical heap, extent zone, and chunk memory of the sharedpool. The Shared Pool, large pool, and PGA are the physical layers of the heap management chunksharedpool, which are composed of many memory blocks. These internal blocks are called chunks, the chunk is the smallest unit of memory allocation in the sharedpool-similar to extent, but the chunk is of different sizes. In the memory, a chunk

This section describes the physical heap, extent zone, and chunk memory of the shared pool. The shared pool, large pool, and PGA are the physical layers of the heap management chunk shared pool, which are composed of many memory blocks, these internal blocks are called chunks. The chunk is the smallest unit of memory allocation in the shared pool-similar to extent, but the chunk is of different sizes. In the memory, a chunk

This section describes the heap, extent, and chunk of the shared pool physical structure.

Memory: The Shared Pool, large pool, and PGA are heap management.
The chunkshared pool is physically composed of many memory blocks called chunk. The chunk is the smallest unit of memory allocation in the shared pool-similar to extent, but the chunk is of different sizes, A chunk in the memory is continuous.
When a chunk is of the available type, it neither belongs to the library cache nor to the dictionary cache,
If the chunk is used to store SQL-related data, the chunk belongs to the library cache;
If the chunk is used to store the data dictionary information, the chunk is a dictionary.
The Chunk can be divided into four types-or four states:
1. free: The chunk does not contain valid objects and can be allocated without restrictions.
2. recr: recreatable, -- reusable. objects contained in the chunk can be temporarily moved away. If necessary, they can be rebuilt, such as sharing SQL statements.
3. freeabl: -- releasable. The session has used this chunk, and the object data stored in it is generated by the session during processing. There is no way to recreate it. This is different from recr. Therefore, the chunk cannot be temporarily removed. However, it can be released within a suitable period of time.
4. perm: permanent, -- permanent SGA fixed object, etc. chunk contains permanent objects, but a large permanent chunk may contain available space. When needed, these spaces can be released.
View the four statuses of the Chunk: -- R-freea, which begins with the chunk in the Reserved Area
SYS @ bys3> select distinct (ksmchcls) from x $ ksmsp;
KSMCHCLS
--------
Freeabl
Recr
Perm
R-freea
R-free
R-perm
Free
R-recr
Query the chunk size in various states, and the average chunk Size
SYS @ bys3> select KSMCHCLS, count (*), round (sum (KSMCHSIZ/1024/1024), 0) MB, round (avg (KSMCHSIZ), 0) from x $ ksmsp group by KSMCHCLS order by 1;
Ksmchcls count (*) mb round (AVG (KSMCHSIZ), 0)
--------------------------------------------------
R-free 43 6 152374
R-freea 98 0 3915
R-perm 4 16 4111578
R-recr 1 4 3977200
Free 1937 0 226
Freeabl 5815 11 2057
Perm 271 89 343653
Recr 11127 13 1250
SYS @ bys3> desc x $ ksmsp
Name
------------
ADDR -- Address in memory
INDX --
INST_ID --
KSMCHIDX --
KSMCHDUR --
KSMCHCOM -- chunk description
KSMCHPTR --
KSMCHSIZ -- chunk size
KSMCHCLS --
KSMCHTYP --
KSMCHPAR --
SYS @ bys3> select count (*) from x $ ksmsp; -- each chunk is recorded in x $ ksmsp, and the number of chunks can be counted.
COUNT (*)
----------
18704
###################
The heap and the extent heap in the shared pool are composed of one or more extent of different sizes, and the extent is composed of chunk.
View the heap/extent/chunk structure in the DUMP Shared Pool: -- create a session
Alter session set events 'immediate trace name heapdump level 2 ';
Select value from v $ diag_info where name like 'de % ';
/U01/diag/rdbms/bys3/bys3/trace/bys3_ora_7876.trc
View TRACE file content: -- find this section: VI search HEAP DUMP
**************************************** **************
Heap dump heap name = "sga heap" desc = 0x200010b4
Extent sz = 0x7ad4 alt = 124 het = 32767 rec = 9 flg =-126 opc = 0
Parent = (nil) owner = (nil) nex = (nil) xsz = 0x0 heap = (nil)
Fl2 = 0x60, nex = (nil)
Ds for latch 1: 0x20030f24
Reserved granule count 0 (granule size 4194304)
**************************************** **************
Heap dump heap name = "sga heap (1, 0)" desc = 0x20030f24
--- Heap name = "sga heap (1st)" subpools in the shared pool -- subbuffers of the advanced heap
Extent sz = 0xfc4 alt = 124 het = 32767 rec = 9 flg =-126 opc = 0
Parent = (nil) owner = (nil) nex = (nil) xsz = 0x400000 heap = (nil)
Fl2 = 0x20, nex = (nil), dsxvers = 1, dsxflg = 0x0
Dsx first ext = 0x2c400000
Latch set 1 of 1
Durations disabled for this heap
Reserved granules for root 0 (granule size 4194304)
EXTENT 0 addr = 0x23c00000 --- EXTENT 0. There are multiple EXTENT instances in the downward search. One EXTENT has multiple chunks.
Chunk 23c00038 sz = 24 R-stopper "reserved stoppe"
Chunk 23c00050 sz= 14300 R-free ""
Chunk 23c0382c sz = 8224 R-freeable "KKSSP ^ 38" ds = 0x23d8f133
Chunk 23c0a8e4 sz = 169732 R-free ""
Chunk 23c33fe8 sz = 24 R-stopper "reserved stoppe"
Chunk 23c34000 sz = 15776 perm "perm" alo = 15776
Chunk 23c37da0 sz = 84 free "" -- free CHUNK, 23c37da0 memory address, 84 bytes, you can see that each chunk has different sizes
Chunk 23c37df4 sz = 236 recreate "KGLHD" latch = (nil) --- CHUNK in recreate State, latch = (nil) No latch
#####

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.