Showing posts with label ORA-04030: out of process memory when trying to allocate 16328 bytes. Show all posts
Showing posts with label ORA-04030: out of process memory when trying to allocate 16328 bytes. Show all posts

Friday, September 26, 2014

ERROR :: ORA-04030: out of process memory when trying to allocate 16328 bytes

Issue: ORA-04030: out of process memory when trying to allocate 16328 bytes (koh-kghu call ,pl/sql vc2)

Following ORA-04030 error is encountered every time when the PGA allocation reaches 15GB:


The incident trace shows 15G used by pl/sql:
=======================================
TOP 10 MEMORY USES FOR THIS PROCESS
---------------------------------------
100%   15 GB, 1008569 chunks: "pl/sql vc2                "  PL/SQL
        koh-kghu call   ds=fffffc7ffc6f51f8  dsprt=c715710
0%   15 MB, 15763 chunks: "free memory               "
        pga heap        ds=c715710  dsprt=0


This is due to bug 14119856 when real free allocator is used even though pga_aggregate_target is set more than 16GB.
Use below query to check if real free allocator is used:

SQL> col name format a30
col cur_val format a20
select i.ksppinm name , v.ksppstvl cur_val, v.ksppstdf default_val,v.ksppstvf
from x$ksppi i, x$ksppcv v where i.indx = v.indx and i.ksppinm in
('_realfree_heap_pagesize_hint', '_use_realfree_heap');SQL> SQL>   2    3

NAME                           CUR_VAL              DEFAULT_V   KSPPSTVF
------------------------------ -------------------- --------- ----------
_realfree_heap_pagesize_hint   65536                TRUE               0
_use_realfree_heap             TRUE                 TRUE               0


Technique 1:


 Step 1:
Restart the database and  server in order to fix the issue
Or
Change the upper limit at either the OS or at the database level:


Change the page count at the OS level:

by root user,
$ more /proc/sys/vm/max_map_count
$ sysctl -w vm.max_map_count=200000 (for example)

OR at database level,
Adjust the realfree heap pagesize within the database by setting the following parameters in the init/spfile and restart the database.

_use_realfree_heap=TRUE
_realfree_heap_pagesize_hint = 262144
- OR -
Use Workaround:

 Set "_use_realfree_heap=false" and restart database instance.

Or

 Apply patch <="" a="">14119856> if available for your platform and Oracle version or request for a one-off patch.

 Reference  MI note :: Doc ID 1506315.1 and Thanks for the giving time and reading the post .

Convert snapshot standby database to Physical standby database: Dataguard 11gR2

Step 1 SQL> shutdown immediate; Step 2 SQL> startup nomount Step 3 SQL> alter database mount; Step 4 SQL>  ALTER DATABASE CONV...