ORA-04030: out of process memory when trying to allocate 16328 bytes (PLSQL Opt Pool,pdziM01_Create: New Set)
OS:RHEL 6.5
DB:11.2.0.4 SINGLE or RAC
This error can be reproduced
alert log file informations:
Fri Mar 31 13:43:53 2017 Errors in file /u01/app/oracle/diag/rdbms/hpaydb/hpaydb1/trace/hpaydb1_ora_122940.trc (incident=245297): ORA-04030: out of process memory when trying to allocate 16328 bytes (PLSQL Opt Pool,pdziM01_Create: New Set) Incident details in: /u01/app/oracle/diag/rdbms/hpaydb/hpaydb1/incident/incdir_245297/hpaydb1_ora_122940_i245297.trc Use ADRCI or Support Workbench to package the incident. See Note 411.1 at My Oracle Support for error and packaging details. Errors in file /u01/app/oracle/diag/rdbms/hpaydb/hpaydb1/trace/hpaydb1_ora_122940.trc (incident=245298): ORA-04030: out of process memory when trying to allocate 8168 bytes (kxs-heap-c,kdbmal allocation) ORA-04030: out of process memory when trying to allocate 16328 bytes (PLSQL Opt Pool,pdziM01_Create: New Set) Incident details in: /u01/app/oracle/diag/rdbms/hpaydb/hpaydb1/incident/incdir_245298/hpaydb1_ora_122940_i245298.trc Use ADRCI or Support Workbench to package the incident. See Note 411.1 at My Oracle Support for error and packaging details. Fri Mar 31 13:43:59 2017 Dumping diagnostic data in directory=[cdmp_20170331134359], requested by (instance=1, osid=122940), summary=[incident=245298]. Fri Mar 31 13:44:01 2017 Sweep [inc][245298]: completed Sweep [inc][245297]: completed Sweep [inc2][245298]: completed Sweep [inc2][245297]: completed
trace file any informations:
Dump continued from file: /u01/app/oracle/diag/rdbms/hpaydb/hpaydb1/trace/hpaydb1_ora_122940.trc ORA-04030: out of process memory when trying to allocate 16328 bytes (PLSQL Opt Pool,pdziM01_Create: New Set) ========= Dump for incident 245297 (ORA 4030) ======== ----- Beginning of Customized Incident Dump(s) ----- ======================================= TOP 10 MEMORY USES FOR THIS PROCESS --------------------------------------- 35% 1413 MB, 90764 chunks: "pdziM01_Create: New Set " SQL PLSQL Opt Pool ds=0x7ff68bc3d440 dsprt=0x7ff6aed8f950 25% 988 MB, 356315 chunks: "permanent memory " PL/SQL DIANA ds=0x7ff6aed8fea8 dsprt=0x7ff6aed8ff48 18% 729 MB, 64768 chunks: "free memory " top call heap ds=0xc0d1f20 dsprt=(nil) 8% 331 MB, 50717 chunks: "permanent memory " SQL kxs-heap-c ds=0x7ff6aed8fac8 dsprt=0xc0d1f20 2% 79 MB, 20499 chunks: "pdzdM80_Allocate_Block " SQL PLS CGA hp ds=0x7ff6aed8f950 dsprt=0x7ff6aed8fac8 2% 76 MB, 75955 chunks: "phdcsql_init_string " SQL PLS CGA hp ds=0x7ff6aed8f950 dsprt=0x7ff6aed8fac8 2% 72 MB, 75955 chunks: "QCI kxsc " PL/SQL DIANA ds=0x7ff6aed8fea8 dsprt=0x7ff6aed8ff48 1% 59 MB, 15192 chunks: "pdzgM60_Make " SQL PLS CGA hp ds=0x7ff6aed8f950 dsprt=0x7ff6aed8fac8 1% 57 MB, 14677 chunks: "pdz8Mz2_Make " SQL PLS CGA hp ds=0x7ff6aed8f950 dsprt=0x7ff6aed8fac8 1% 45 MB, 11564 chunks: "pdz7M87_Make " SQL PLS CGA hp ds=0x7ff6aed8f950 dsprt=0x7ff6aed8fac8 ======================================= PRIVATE MEMORY SUMMARY FOR THIS PROCESS --------------------------------------- ****************************************************** PRIVATE HEAP SUMMARY DUMP 4074 MB total: <----- here we see the 4G limit being hit 3344 MB commented, 421 KB permanent 729 MB free (0 KB in empty extents), 2940 MB, 1 heap: "kxs-heap-c " 718 MB free held 1113 MB, 1 heap: "callheap " 11 MB free held ------------------------------------------------------ Summary of subheaps at depth 1 3320 MB total: 2984 MB commented, 331 MB permanent 4853 KB free (0 KB in empty extents), 1885 MB, 1 heap: "PLS CGA hp " 4551 KB free held 1093 MB, 1 heap: "TCHK^e468089c " ------------------------------------------------------ Summary of subheaps at depth 2 2966 MB total: 2920 MB commented, 10 MB permanent 35 MB free (0 KB in empty extents), 1420 MB, 1 heap: "PLSQL Opt Pool " 1084 MB, 1 heap: "PL/SQL DIANA " 111 MB, 75955 chunks: "phdcsql_init_string " 35 MB free held 79 MB, 20499 chunks: "pdzdM80_Allocate_Block "
Sql statement of the session information(the Anonymous stored procedure A consists of 75955 single sqls):
*** 2017-03-31 13:43:54.541 dbkedDefDump(): Starting incident default dumps (flags=0x2, level=3, mask=0x0) ----- Current SQL Statement for this session (sql_id=2kmqk6rk6h24w) ----- declare begin update t_supplier_device_temp t set t.active_status=1,t.active_type='02', t.active_time= '20170421' where t.csn='407F236B197025D30100'; update t_supplier_device_temp t set t.active_status=1,t.active_type='02', t.active_time= '20170425' where t.csn='7F0B6B20D94562DA0100'; ....... update t_supplier_device_temp t set t.active_status=1,t.active_type='02', t.active_time= '20170422' where t.csn='982423A18268F1590100'; update t_supplier_device_temp t set t.active_status=1,t.active_type='02', t.active_time= '20170411' where t.csn='64C67E976DA46E540100'; update t_supplier_device_temp t set t.active_status=1,t.active_type='02', t.active_time= '20170423' where t.csn='401EE5AF024AAF2B0100'; end; ----- Process Map Dump ----- ******************* Dumping process map **************** 00400000-0bcd4000 r-xp 00000000 fc:19 3024801 /u01/app/oracle/product/11.2.0/db_1/bin/oracle 0bed4000-0c0cd000 rw-p 0b8d4000 fc:19 3024801 /u01/app/oracle/product/11.2.0/db_1/bin/oracle 0c0cd000-0c124000 rw-p 00000000 00:00 0 0d0cc000-0d15c000 rw-p 00000000 00:00 0 [heap] 60000000-60001000 r--s 00000000 00:10 27536592 /dev/shm/ora_hpaydb1_917511_0 60001000-80000000 rw-s 00001000 00:10 27536592 /dev/shm/ora_hpaydb1_917511_0 ........ 7ff6b0eeb000-7ff6b0eec000 rw-p 00001000 fc:19 2888649 /u01/app/oracle/product/11.2.0/db_1/lib/libodmd11.so 7ff6b0eec000-7ff6b0eed000 rw-p 00000000 00:00 0 7fff4dcaa000-7fff4dce6000 rw-p 00000000 00:00 0 [stack] 7fff4ddfe000-7fff4de00000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] <---End of the map dump at (Line 65532 of the Process Map Dump) ******************* End of process map dump *
The default realfree allocator pagesize is 64 kB (65536), so 64K entries take up 4GB. With 256kB (262144) pages, the limit goes to 16GB.
CAUSE:
These errors usually show up because of running out of map entries from the OS. There are only 65184 memory map entries per process.
OTHER:
The ORA-4030 can occur for a variety of reasons. Some common causes are:
1.OS Memory limit reached such as physical memory and/or swap/virtual paging.
For instance, IBM AIX can experience ORA-4030 issues related to swap scenarios.
2.OS limits reached (kernel or user shell limits) that limit overall, user level or process level memory
3.OS limit on PGA memory size due to SGA attach address. Re
4.Oracle internal limit on functionality like PL/SQL varrays or bulk collections.
ORA-4030 errors will include arguments like "pl/sql vc2" "pmucalm coll" "pmuccst: adt/re".
5.Application design causing limits to be reached
6.Bug – space leaks, heap leaks