Hi,

I planned this answer a short one, but...

> Could you explain what is recreatable /freeable
> chunks and
> once recreatable chunks is removed from memory
> where it is kept.

Memory allocations from shared pool heap or its subheaps are done in chunks. When 
allocating a chunk from shared pool heap, the requestor states how many bytes it wants 
and which type the chunk will be. The major types requested can be free, freeable, 
recreatable and permanent.

Descriptions of chunk types:
Free:
  The chunk is free and can be allocated to any request with equal or smaller size (it 
is on appropriate freelist in its heap, depending on its size).

Freeable:
  Freeable chunks are currently in use, but can be explicitly freed by their 
allocators. Shared pool heap manager will not free those chunks automatically if a new 
allocation has to be made.

Recreatable:
  This chunk is used, but its contents can be regenerated if needed (such are 
execution plans for cursors for example), thus Oracle can automatically reuse these 
chunks for others (of course when these chunks arenīt in use, thus unpinned). So when 
this information orignially stored in recreatable chunk is needed again, a callback 
function is executed, to recreate the contents in a chunk - callback functions 
containing instructions to recreate the information are registered for each 
recreatable chunk in heap manager's area if I recall correctly...)
Information about unpinned recreatable chunks are held in heap LRU lists.

Permanent:
  This allocation type states that once allocated, this memory is never freed during 
instance lifetime, even when flush shared_pool is issued.

Freeable and Permanent chunks do not have to be in any LRU or freelists, because of 
their nature (when a "freeable" chunk is freed, then it becomes a "free" chunk and 
only then it goes to a freelist)

When shared pool is initialized during startup, half of its free memory will be 
allocated for a special type of permanent chunk, which can be "freed" in increments in 
case when both freelists and LRU lists don't have enough contiguous space in them. (It 
gets more complex starting from shared pool size about 67M)


Note that I'm just beginning to explore the (quite interesting) world of Oracle SGA, 
so I might not be 100% correct.

Tanel.

Reply via email to