We got the first ORA-04031 at 10 PM for a tiny memory allocation of 40 bytes:
2019-07-22T22:00:48.776288+02:00
Errors in file
/u00/oracle/orabase/diag/rdbms/DB1_site1/DB1/trace/DB1_ora_28267.trc
(incident=230935):
ORA-04031: unable to allocate 40 bytes of shared memory ("shared
pool","GV$SQL","KGLH0^6b31dba1","kglHeapInitialize:temp")
The problem persisted until we restarted the instance around half an hour
later, even though we, at least at some point, had enough free memory in both
subpools:
2019-07-22T22:35:41.573895+02:00
Errors in file
/u00/oracle/orabase/diag/rdbms/DB1_site1/DB1/trace/DB1_cjq0_29161.trc:
ORA-04031: unable to allocate bytes of shared memory ("","","","")
ORA-04031: unable to allocate 40 bytes of shared memory ("shared pool","unknown
object","KGLH0^c10d8511","kglHeapInitialize:temp")
==============================================
TOP 10 MEMORY USES FOR SGA HEAP SUB POOL 1
----------------------------------------------
"object queue hash buckets " 192 MB 28%
"free memory " 176 MB 26%
"dbwriter coalesce buffer " 48 MB 7%
"kglsim object batch " 41 MB 6%
"ASH buffers " 32 MB 5%
"kglsim heap " 22 MB 3%
"execution ID memory " 19 MB 3%
"dirty object counts array " 12 MB 2%
"KGLH0 " 7714 KB 1%
"event statistics per sess " 7485 KB 1%
-----------------------------------------
free memory 176 MB
memory alloc. 512 MB
Sub total 688 MB
==============================================
==============================================
TOP 10 MEMORY USES FOR SGA HEAP SUB POOL 2
----------------------------------------------
"free memory " 230 MB 35%
"Checkpoint queue " 96 MB 15%
"keomg: entry list " 59 MB 9%
"kglsim object batch " 41 MB 6%
"ASH buffers " 30 MB 5%
"kglsim heap " 22 MB 3%
"execution ID memory " 19 MB 3%
"event statistics per sess " 7485 KB 1%
"simulator latch/bucket st " 7424 KB 1%
"write state object " 7420 KB 1%
-----------------------------------------
free memory 230 MB
memory alloc. 426 MB
Sub total 656 MB
==============================================
Many sessions were affected. Also, creating new sessions wasn't possible.
According to the system dump the affected sessions were waiting on MMAN to
finish a memory resizing operation:
...
7: MMAN ospid 26758 sid 71 ser 33258, waiting for 'rdbms ipc message'
...
72: CJQ0 ospid 29161 sid 721 ser 22160, waiting for 'SGA: allocation
forcing component growth'
Blocked by inst: 1, sid: 71, ser: 33258
Final Blocker inst: 1, sid: 71, ser: 33258
...
But MMAN seemed idle ('rdbms ipc message').
I concluded following:
1. Due to the shared pool shortage MMAN started growing it.
2. At some point, there was enough memory to fulfill the requests, but they
were failing, because the sessions were waiting on MMAN to finish the resizing.
My questions are:
1. Are my conclusions correct?
2. How does a session makes a decision whether to allocate a chunk from the
free memory or to wait on 'SGA: allocation forcing component growth'?
Best regards,
Nenad
https://nenadnoveljic.com/blog/
____________________________________________________
Please consider the environment before printing this e-mail.
Bitte denken Sie an die Umwelt, bevor Sie dieses E-Mail drucken.
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">p { font-family: Arial;font-size:9pt }</style>
</head>
<body>
<p>
<br>Important Notice</br>
<br />
This message is intended only for the individual named. It may contain
confidential or privileged information. If you are not the named addressee you
should in particular not disseminate, distribute, modify or copy this e-mail.
Please notify the sender immediately by e-mail, if you have received this
message by mistake and delete it from your system.<br />
Without prejudice to any contractual agreements between you and us which shall
prevail in any case, we take it as your authorization to correspond with you by
e-mail if you send us messages by e-mail. However, we reserve the right not to
execute orders and instructions transmitted by e-mail at any time and without
further explanation.<br />
E-mail transmission may not be secure or error-free as information could be
intercepted, corrupted, lost, destroyed, arrive late or incomplete. Also
processing of incoming e-mails cannot be guaranteed. All liability of Vontobel
Holding Ltd. and any of its affiliates (hereinafter collectively referred to as
"Vontobel Group") for any damages resulting from e-mail use is excluded. You
are advised that urgent and time sensitive messages should not be sent by
e-mail and if verification is required please request a printed version.</br>
Please note that all e-mail communications to and from the Vontobel Group are
subject to electronic storage and review by Vontobel Group. Unless stated to
the contrary and without prejudice to any contractual agreements between you
and Vontobel Group which shall prevail in any case, e-mail-communication is for
informational purposes only and is not intended as an offer or solicitation for
the purchase or sale of any financial instrument or as an official confirmation
of any transaction.<br />
The legal basis for the processing of your personal data is the legitimate
interest to develop a commercial relationship with you, as well as your consent
to forward you commercial communications. You can exercise, at any time and
under the terms established under current regulation, your rights. If you
prefer not to receive any further communications, please contact your client
relationship manager if you are a client of Vontobel Group or notify the sender.
Please note for an exact reference to the affected group entity the corporate
e-mail signature.
For further information about data privacy at Vontobel Group please consult <a
href="https://www.vontobel.com";>www.vontobel.com</a>.<br />
</p>
</body>
</html>