Wednesday, August 1, 2018

Memory Notification: Library Cache Object loaded into SGA

Summary 
In the Oracle10g a new heap checking mechanism, together with a new messaging system is introduced. This new mechanism reports memory allocations above a threshold in the alert.log, together with a tracefile in the udump directory. If you notice in your alert.log you may get messages like this:

Memory Notification: Library Cache Object loaded into SGA
Heap size 58689K exceeds notification threshold (51200K)
This message means that the threshold set by hidden parameter _kgl_large_heap_warning_threshold has been exceeded

In certain situations this can be very helpful to inform you if large allocations have been done in the sga heap (shared pool). The notification mechanism allows you to troubleshoot memory allocation problems, which eventually will appear as the infamous ORA-4031

If you don't have ORA-04031: unable to allocate x bytes of shared memory problems and don't want to appear the message in the alert log then you can increase the hidden parameter _kgl_large_heap_warning_threshold. 

The default limit is set at 2048K. To find the value of this parameter execute

SELECT * FROM (
SELECT a.ksppinm AS parameter,
       a.ksppdesc AS description,
       b.ksppstvl AS session_value,
       c.ksppstvl AS instance_value
FROM   x$ksppi a,
       x$ksppcv b,
       x$ksppsv c
WHERE  a.indx = b.indx
AND    a.indx = c.indx
AND    a.ksppinm LIKE '/_%' ESCAPE '/'
ORDER BY a.ksppinm) 
WHERE parameter IN ('_kgl_large_heap_warning_threshold')
In the description of the parameter indicates: maximum heap size before KGL writes warnings to the alert log 

Workaround 
If you want to disappear the message from the alert.log increase the hidden parameter to something bigger, for example

ALTER SYSTEM SET "_kgl_large_heap_warning_threshold" = 89428800 SCOPE=SPFILE ;

No comments: