My Oracle Support Banner

ORA-04031 Due To High Shared Pool Usage To "GCS DYNAMIC RESOURCES FG" With In-Memory Option (DBIM) (Doc ID 2200825.1)

Last updated on AUGUST 04, 2018

Applies to:

Oracle Database - Enterprise Edition - Version 12.1.0.2 to 12.1.0.2 [Release 12.1]
Information in this document applies to any platform.

Symptoms

- Shared pool memory allocation errors are seen in a 12c RAC environment with tables populated into in-memory.

- The reported memory errors look like:

ORA-04031: unable to allocate 2881280 bytes of shared memory ("shared pool","unknown object","sga heap(1,0)","ktmc_dlm_lck")
ORA-04031: unable to allocate 40 bytes of shared memory ("shared pool","unknown object","KGLH0^578a2b77","kglHeapInitialize:temp")
ORA-04031: unable to allocate 40 bytes of shared memory ("shared pool","select t.ts#,t.file#,t.block...","KGLH0^1182baa5","kglHeapInitialize:temp")
ORA-04031: unable to allocate 4192 bytes of shared memory ("shared pool","unknown object","sga heap(3,0)","parameter handle")


- The environment where the issue is hit, has the following memory setting:

sga_max_size = 400G
sga_target = 400G
inmemory_size = 350G


 - 4031 diagnostic information shows most of the shared_pool memory is used by 'gcs dynamic resources fg' and 'ktmc_dlm_lck' structures:

TOP 10 MEMORY USES FOR SGA HEAP SUB POOL 1
----------------------------------------------
"gcs dynamic resources fg " 4421 MB 54%
"ktmc_dlm_lck " 1763 MB 22%
"free memory " 911 MB 11%
...................
-----------------------------------------
free memory 2281 MB
memory alloc. 15 GB
Sub total 17 GB
==============================================
TOP 10 MEMORY USES FOR SGA HEAP SUB POOL 2
----------------------------------------------
"gcs dynamic resources fg " 4430 MB 54%
"ktmc_dlm_lck " 1888 MB 23%
"free memory " 891 MB 11%
..................
-----------------------------------------
free memory 2261 MB
memory alloc. 14 GB
Sub total 17 GB
==============================================
TOP 10 MEMORY USES FOR SGA HEAP SUB POOL 3
----------------------------------------------
"gcs dynamic resources fg " 4435 MB 54%
"ktmc_dlm_lck " 1845 MB 23%
"free memory " 918 MB 11%
.............
-----------------------------------------
free memory 2309 MB
memory alloc. 15 GB
Sub total 17 GB
==============================================
TOP 10 MEMORY USES FOR SGA HEAP SUB POOL 4
----------------------------------------------
"gcs dynamic resources fg " 4438 MB 54%
"ktmc_dlm_lck " 1837 MB 22%
"free memory " 900 MB 11%
......................
-----------------------------------------
free memory 2277 MB
memory alloc. 14 GB
Sub total 17 GB
==============================================
TOP 10 MEMORY USES FOR SGA HEAP SUB POOL 5
----------------------------------------------
"gcs dynamic resources fg " 4426 MB 54%
"ktmc_dlm_lck " 1713 MB 21%
"free memory " 1057 MB 13%
............
-----------------------------------------
free memory 2431 MB
memory alloc. 14 GB
Sub total 17 GB
TOTALS ---------------------------------------
Total free memory 11 GB
Total memory alloc. 72 GB
Grand total 84 GB

 

 
- Oracle views also report 'gcs dynamic resources fg' and 'ktmc_dlm_lck' structures consuming huge amount of memory:


SQL> SELECT inst_id,decode(con_id,1,'1','*') con_id,pool,name , ROUND (SUM (bytes/ 1024 / 1024 / 1024), 2) gb
FROM gv$sgastat s
WHERE (pool = 'shared pool' and name in ('ktmc_dlm_lck','PDBHP') ) or (pool= 'numa pool' and name like 'gcs dynamic resources %')
GROUP BY inst_id,decode(con_id,1,'1','*'),pool,name
order by 1,2;

INST_ID C POOL NAME GB
---------- - ------------ -------------------------- ----------
1 * shared pool ktmc_dlm_lck 7.6
...
1 * shared pool gcs dynamic resources fg 21.79
...

 

Changes

DBIM in RAC mode allocates DLM, KCL locks for coherency of data across the RAC cluster. Those memory allocations come from the shared pool and not from the inmemory area.
Note that these allocations are in addition to what buffer cache might allocate for DLM/KCL locks for the database blocks resident in the buffer cache. 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.