PL/SQL Using XMLDOM Packages Seems To Leak Memory Under Chunk QMXDPLS_SUBHEA (Doc ID 784804.1)

Last updated on NOVEMBER 28, 2016

Applies to:

Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 11.1.0.7 - Release: 10.2 to 11.1
Information in this document applies to any platform.
Oracle Server Enterprise Edition - Version: 10.2.0.1 to 11.1.0.7

Symptoms

This article is written specifically for when the XMLDOM package is in use and a memory leak is seen in conjunction with the following symptoms:
  1. An ORA-04030 error 'might' be seen:
    ORA-04030: out of process memory when trying to allocate 10504 bytes (pga heap,kgh stack)
    ORA-27300: OS system dependent operation:fork failed with status: 12
    ORA-27301: OS failure message: Not enough space
    ORA-27302: failure occurred at: skgpspawn3
  2. A HEAPDUMP is obtained under the following conditions:

    While running the PLSQL, issue:
    select pid, spid, substr(username,1,20) "USER", program,
           PGA_USED_MEM, PGA_ALLOC_MEM, PGA_FREEABLE_MEM, PGA_MAX_MEM
    from v$process
    where pga_alloc_mem = (select max(pga_alloc_mem) from v$process
                           where program not like '%LGWR%');

    Run the query over time as the job runs and see how excessive PGA memory grows for the job. If it gets into the high 100s of MBytes or even into the GBytes, then get a full heapdump to see where the memory is growing:
    sqlplus /nolog
    connect / as sysdba
    oradebug setorapid <pid from above>
    oradebug unlimit
    oradebug dump heapdump 536870917
    oradebug tracefile_name
    exit

    The ORADEBUG TRACEFILE_NAME command provides the full path and filename of the heap dump just generated.
  3. The HEAPDUMP trace shows many extents and memory chunks of type:

    ******************************************************
    HEAP DUMP heap name="session heap" desc=ffffffff7ae26298
    extent sz=0xff80 alt=32767 het=32767 rec=0 flg=2 opc=2
    parent=105de6a00 owner=4670e9378 nex=0 xsz=0xff80
    EXTENT 0 addr=ffffffff4fbb0080
    Chunk ffffffff4fbb0090 sz= 65392 free " "
    EXTENT 1 addr=ffffffff4fba0080
    Chunk ffffffff4fba0090 sz= 2216 freeable "qmxdpls_subhea " ds=ffffffff7a067f58

    The type being: "qmxdpls_subhea "

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms