Memory Leak in Oracle BLOB writing

Hi,
We have strange performance problem. Our profiler shows that Oracle connection object holds the inserted BLOB (byte[]) data. This is not getting released at all.
The details are below.
BLOB writing method:
==============
We are using Hibernate ORM along with Spring framework's OracleLobHandler for handling the LOB data. Spring uses xLOb.createTemporary.. method to insert the LOB data and finally it clears that by calling xLOB.freetemporary method. But still the data is left in the connection object.
I have tried passing 'cache=false' to the createTemporary method. But of no use.
Versions:
======
Oracle DB = Oracle 10G
Oracle jdbc driver = 10.2.0.2.0
Spring framework = 2.5
Hibernate ORM = 3.2.3 ga
Here is our profiler output (Your kit):
=================
byte[30123012]   outBuffer of oracle.jdbc.driver.T4C8TTIBlob       blobMsg of oracle.jdbc.driver.T4CConnection         _conn of org.apache.tomcat.dbcp.dbcp.PoolableConnection               value of org.apache.tomcat.dbcp.pool.impl.GenericObjectPool$ObjectTimestampPair                   _val of org.apache.tomcat.dbcp.collections.CursorableLinkedList$Listable                           _next of org.apache.tomcat.dbcp.collections.CursorableLinkedList$Listable
Please help me to solve the issue.

Simulating the same environment in standalone java program is a big work i guess. That is like developing a new application. :) I hope you understand the problem.
If you can please try to answer my question below. I may not need the exact answer, but may need a direction to debug the problem. Since i dont have access to Oracle driver source, i dont know what is happening inside. That is not the case with others (Hibernate, Spring - are open source projects).
Here i have attached the oracle jdbc log file for the write & freetemporary operation. I can able see that the BLOB.freememory & connection.freememory is happening. But still objects are available in the buffer of the Connection object. I guess if you could see that something might strike for you..we may be missed something...
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection setAutoCommit
INFO: PhysicalConnection.setAutoCommit(autoCommit=trMay 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection setAutoCommit
INFO: PhysicalConnection.setAutoCommit(autoCommit=true)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection setAutoCommit
INFO: PhysicalConnection.setAutoCommit(autoCommit): return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection isClosed
FINE: PhysicalConnection.isClosed() returned true
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection getAutoCommit
INFO: PhysicalConnection.getAutoCommit() returned true
May 27, 2009 4:04:47 PM oracle.sql.BLOB freeTemporary
FINE: BLOB.freeTemporary() -- no return trace --
May 27, 2009 4:04:47 PM oracle.sql.BLOB getDBAccess
FINE: BLOB.getDBAccess()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection isClosed
FINE: PhysicalConnection.isClosed() returned true
May 27, 2009 4:04:47 PM oracle.sql.BLOB getDBAccess
FINE: BLOB.getDBAccess: return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CConnection freeTemporary
FINE: oracle.jdbc.driver.T4CConnection.freeTemporary(oracle.sql.BLOB@572554)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CConnection freeTemporary
FINE: oracle.jdbc.driver.T4CConnection.freeTemporary: return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection setTransactionIsolation
INFO: PhysicalConnection.setTransactionIsolation(level=2)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection createStatement
FINE: PhysicalConnection.createStatement(resultSetType=-1, resultSetConcurrency=-1)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement <init>
FINE: OracleStatement.OracleStatement(conn, batchValue=1, rowPrefetchValue=10, UserResultSetType=-1)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
FINE: PhysicalConnection.registerHeartbeat()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection getDefaultFixedString
INFO: PhysicalConnection.getDefaultFixedString() returning false
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement <init>
FINE: OracleStatement.OracleStatement(c, batch_value, UserResultSetType):return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection createStatement
FINE: PhysicalConnection.createStatement(resultSetType, resultSetConcurrency):return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement execute
FINE: OracleStatement.execute(sql)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement execute
FINE: OracleStatement.execute(sql):return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement sendBatch
FINE: OracleStatement.sendBatch()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleSql initialize
FINE: OracleSql.initialize(ALTER SESSION SET ISOLATION_LEVEL = READ COMMITTED)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleSql initialize
FINE: OracleSql.initialize:return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleSql computeBasicInfo
FINE: OracleSql.computeBasicInfo(ALTER SESSION SET ISOLATION_LEVEL = READ COMMITTED)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleSql computeBasicInfo
FINE: OracleSql.computeBasicInfo:return: sqlKind = 3 parameterCount = 0
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement doExecuteWithTimeout
FINE: OracleStatement.doExecuteWithTimeout() needToPrepareDefineBuffer = true
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement doExecuteWithTimeout
CONFIG: SQL: "ALTER SESSION SET ISOLATION_LEVEL = READ COMMITTED"
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
FINE: PhysicalConnection.registerHeartbeat()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CConnection open
FINE: T4CConnection.open(oracle.jdbc.driver.T4CStatement@18bd34e)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CConnection open
FINE: T4CConnection.open: return oracle.jdbc.driver.T4CStatement@18bd34e
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CStatement executeForRows
FINE: oracle.jdbc.driver.T4CStatement.execute_for_rows(false)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.DBConversion StringToCharBytes
FINE: DBConversion.StringToCharBytes(ALTER SESSION SET ISOLATION_LEVEL = READ COMMITTED)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.DBConversion getServerCharSetId
FINE: DBConversion.getDbCharSet(): returned 178
May 27, 2009 4:04:47 PM oracle.jdbc.driver.DBConversion getNCharSetId
FINE: DBConversion.getNCharSetId(): returned 2000
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CStatement executeForRows
FINE: oracle.jdbc.driver.T4CStatement.execute_for_rows:return: validRows = 0
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement doExecuteWithTimeout
FINE: OracleStatement.doExecuteWithTimeout():return validRows = 0, needToPrepareDefineBuffer = true
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement closeOrCache
FINE: OracleStatement.closeOrCache(null)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement hardClose
FINE: OracleStatement.hardClose(closeCursor)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement alwaysOnClose
FINE: OracleStatement.alwaysOnClose()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection isClosed
FINE: PhysicalConnection.isClosed() returned true
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement alwaysOnClose
FINE: OracleStatement.alwaysOnClose : return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CStatement doClose
FINE: oracle.jdbc.driver.T4CStatement.do_close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CStatement doClose
FINE: oracle.jdbc.driver.T4CStatement.do_close:return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement hardClose
FINE: OracleStatement.hardClose : return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement closeOrCache
FINE: OracleStatement.closeOrCache : return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection isReadOnly
INFO: PhysicalConnection.isReadOnly()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
ue)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection setAutoCommit
INFO: PhysicalConnection.setAutoCommit(autoCommit): return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection isClosed
FINE: PhysicalConnection.isClosed() returned true
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection getAutoCommit
INFO: PhysicalConnection.getAutoCommit() returned true
May 27, 2009 4:04:47 PM oracle.sql.BLOB freeTemporary
FINE: BLOB.freeTemporary() -- no return trace --
May 27, 2009 4:04:47 PM oracle.sql.BLOB getDBAccess
FINE: BLOB.getDBAccess()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection isClosed
FINE: PhysicalConnection.isClosed() returned true
May 27, 2009 4:04:47 PM oracle.sql.BLOB getDBAccess
FINE: BLOB.getDBAccess: return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CConnection freeTemporary
FINE: oracle.jdbc.driver.T4CConnection.freeTemporary(oracle.sql.BLOB@572554)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CConnection freeTemporary
FINE: oracle.jdbc.driver.T4CConnection.freeTemporary: return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection setTransactionIsolation
INFO: PhysicalConnection.setTransactionIsolation(level=2)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection createStatement
FINE: PhysicalConnection.createStatement(resultSetType=-1, resultSetConcurrency=-1)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement <init>
FINE: OracleStatement.OracleStatement(conn, batchValue=1, rowPrefetchValue=10, UserResultSetType=-1)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
FINE: PhysicalConnection.registerHeartbeat()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection getDefaultFixedString
INFO: PhysicalConnection.getDefaultFixedString() returning false
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement <init>
FINE: OracleStatement.OracleStatement(c, batch_value, UserResultSetType):return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection createStatement
FINE: PhysicalConnection.createStatement(resultSetType, resultSetConcurrency):return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement execute
FINE: OracleStatement.execute(sql)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement execute
FINE: OracleStatement.execute(sql):return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement sendBatch
FINE: OracleStatement.sendBatch()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleSql initialize
FINE: OracleSql.initialize(ALTER SESSION SET ISOLATION_LEVEL = READ COMMITTED)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleSql initialize
FINE: OracleSql.initialize:return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleSql computeBasicInfo
FINE: OracleSql.computeBasicInfo(ALTER SESSION SET ISOLATION_LEVEL = READ COMMITTED)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleSql computeBasicInfo
FINE: OracleSql.computeBasicInfo:return: sqlKind = 3 parameterCount = 0
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement doExecuteWithTimeout
FINE: OracleStatement.doExecuteWithTimeout() needToPrepareDefineBuffer = true
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement doExecuteWithTimeout
CONFIG: SQL: "ALTER SESSION SET ISOLATION_LEVEL = READ COMMITTED"
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
FINE: PhysicalConnection.registerHeartbeat()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CConnection open
FINE: T4CConnection.open(oracle.jdbc.driver.T4CStatement@18bd34e)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CConnection open
FINE: T4CConnection.open: return oracle.jdbc.driver.T4CStatement@18bd34e
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CStatement executeForRows
FINE: oracle.jdbc.driver.T4CStatement.execute_for_rows(false)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.DBConversion StringToCharBytes
FINE: DBConversion.StringToCharBytes(ALTER SESSION SET ISOLATION_LEVEL = READ COMMITTED)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.DBConversion getServerCharSetId
FINE: DBConversion.getDbCharSet(): returned 178
May 27, 2009 4:04:47 PM oracle.jdbc.driver.DBConversion getNCharSetId
FINE: DBConversion.getNCharSetId(): returned 2000
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CStatement executeForRows
FINE: oracle.jdbc.driver.T4CStatement.execute_for_rows:return: validRows = 0
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement doExecuteWithTimeout
FINE: OracleStatement.doExecuteWithTimeout():return validRows = 0, needToPrepareDefineBuffer = true
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement closeOrCache
FINE: OracleStatement.closeOrCache(null)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement hardClose
FINE: OracleStatement.hardClose(closeCursor)
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement alwaysOnClose
FINE: OracleStatement.alwaysOnClose()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection isClosed
FINE: PhysicalConnection.isClosed() returned true
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement alwaysOnClose
FINE: OracleStatement.alwaysOnClose : return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CStatement doClose
FINE: oracle.jdbc.driver.T4CStatement.do_close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.T4CStatement doClose
FINE: oracle.jdbc.driver.T4CStatement.do_close:return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement hardClose
FINE: OracleStatement.hardClose : return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleStatement closeOrCache
FINE: OracleStatement.closeOrCache : return
May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection isReadOnly
INFO: PhysicalConnection.isReadOnly()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
May 27, 2009 4:04:47 PM oracle.jdbc.May 27, 2009 4:04:47 PM oracle.jdbc.driver.PhysicalConnection isClosed
FINE: PhysicalConnection.isClosed() returned true

Similar Messages

  • Memory leak in Oracle Text under Oracle 8.1.7!!!

    When I wanted to use USER_DATASOTRE preference to use my own formatting tag in Oracle Text, the memory leak occured in Oracle Text!
    Memory just freed when I close SQL*Plus program
    My formatting procedure is so easy
    PROCEDURE format_tag(r IN ROWID, tlob IN OUT NOCOPY CLOB) IS
    BEGIN
    SELECT '<C>' &#0124; &#0124; catalog_id &#0124; &#0124; '</C></T>' &#0124; &#0124; tag_id &#0124; &#0124; '</T><V>' &#0124; &#0124; tag_value &#0124; &#0124; '</V>' INTO buf
    FROM tbl_catalog WHERE ROWID=r;
    dbms_lob.trim(tlob, 0); -- set LOB's size to zero
    dbms_lob.write(tlob, length(buf), 1, buf);
    END;
    The typical rows are about 100,000 ( The actual records are tens of millions )
    How can I solve this problem?

    Thanks for your reply
    I'm using Oracle 8.1.7.0.0 on Windows 2000
    The preferences are as follows:
    DECLARE
    ds VARCHAR2(30):= 'dts_catalog';
    grp VARCHAR2(30):= 'grp_catalog';
    lxr VARCHAR2(30):= 'lxr_catalog';
    wrd VARCHAR2(30):= 'wrd_catalog';
    BEGIN
    ctx_ddl.create_preference(wrd, 'BASIC_WORDLIST');
    ctx_ddl.set_attribute(wrd, 'STEMMER', 'NULL');
    ctx_ddl.create_preference(lxr, 'BASIC_LEXER');
    ctx_ddl.set_attribute(lxr, 'INDEX_TEXT', 'TRUE');
    ctx_ddl.set_attribute(lxr, 'INDEX_THEMES', 'FALSE');
    ctx_ddl.create_preference(ds, 'USER_DATASTORE');
    ctx_ddl.set_attribute(ds, 'OUTPUT_TYPE', 'VARCHAR2');
    ctx_ddl.set_attribute(ds, 'PROCEDURE', 'pkg_catalog.format');
    ctx_ddl.create_section_group(grp, 'BASIC_SECTION_GROUP');
    ctx_ddl.add_field_section(grp, 'catalog', 'C', TRUE);
    ctx_ddl.add_field_section(grp, 'tag', 'T', TRUE);
    TRUE);
    ctx_ddl.add_field_section(grp, 'value', 'V', TRUE);
    END;
    the STORAGE preferences are not here ( because they are long )
    Index statement that I used for indexing
    CREATE INDEX idx_catalog_info ON tbl_catalog_info(val)
    INDEXTYPE IS ctxsys.context
    PARAMETERS(
    'STORAGE stg_catalog
    DATASTORE dts_catalog
    SECTION GROUP grp_catalog
    LEXER lxr_catalog
    WORDLIST wrd_catalog
    MEMORY 24M'
    I changed my last version of procedure and using VARCHAR2 parameter type instead of CLOB, but memory leak persist during building index.
    so I used a simple trick by writing a package and counting the records to be indexed, after each 100,000 records I used DBMS_SESSION.FREE_UNUSED_USER_MEMORY procedure to free unused session's memory.
    the package is as follows:
    CREATE OR REPLACE PACKAGE pkg_catalog IS
    PROCEDURE format(r ROWID, buf IN OUT NOCOPY VARCHAR2);
    END pkg_catalog;
    CREATE OR REPLACE PACKAGE BODY pkg_catalog IS
    recs PLS_INTEGER:= 0;
    PROCEDURE format(r ROWID, buf IN OUT NOCOPY VARCHAR2) IS
    BEGIN
    SELECT '<C>'&#0124; &#0124;catalog_id&#0124; &#0124;'</C><T>'&#0124; &#0124;tag_id&#0124; &#0124;subfield_id&#0124; &#0124;'</T><V>'&#0124; &#0124;val&#0124; &#0124;'</V>' INTO buf FROM &usr.tbl_catalog_info WHERE ROWID=r;
    recs:= recs + 1;
    IF recs>100000 THEN
    recs:= 0;
    dbms_session.free_unused_user_memory; -- clean-out memory garbage
    END IF;
    END format;
    END pkg_catalog;
    My problem solved, but it is very marvelous "Why Oracle does not free unused session's memory?"

  • Memory leak in oracle.exe and mds.exe

    We are facing Memory leak in oue MDM server. Our environment details
    are as follows;
    MDM 5.5 SP5 ( Build 5.5.41.70)
    Oracle 10.2 patch 2
    windows server 2003 SP1
    XI 7.0 SP 9
    If server is running continuously 3-4 days then Nonpaged memory is
    getting exausted and server does not respond. Now we have to retart the
    windows server manually.
    If we see the task manager it is shows more than 200,000 handles for
    oracle.exe and more than 100,000 handles for mds.exe.
    1: Oracle.exe -- more than 200000 handles ( Approx >5000 is problem)
    2: Mds.exe -- more than 100000 handles ( Approx >5000 is problem)
    Since these applications are not releasing the handles properly so all
    nonpaged memory gets exausted and server stops responding.
    If we restart the mdm server, database and OracleserviceMDMD, then
    nonpaged memory is released. But some times even if we restart these
    services, we do not get nonpaged memory released. So we have to restart
    the windows server.
    please help me if anyone else have faced the same problem.
    regards
    Saurabh

    Closing as question is answered in MDM forum.

  • Memory leak using Oracle thin driver on wls6.1...

    Hi, I've been attempting to find a memory leak in an application that
    runs on WLS 6.1 SP2, on Solaris 8 and accessing an Oracle 9i db. We
    are using the Type 4 (Thin) driver and JProbe reports that hundreds of
    oracle.jdbc.* objects are left on the heap after my test case
    completes. Specifically oracle.jdbc.ttc7.TTCItem is the most common
    loiterer on the heap. I have verified that after each database access
    the resources are release correctly (i.e. ResultSet, Connection,
    PreparedStatement, etc.)
    Has anyone encountered similar problems? or does anyone know how to
    fix this?
    Thanks,
    Tim Watson

    Hi Tim!
    We have seen problem using oracle 817 client that has been resolved using
    901 client for type2(oci) driver, But i am not aware of thin driver
    problem. You should check with oracle if they have find any customer's
    with this problem.
    Thanks,
    Mitesh
    Tim Watson wrote:
    Hi, I've been attempting to find a memory leak in an application that
    runs on WLS 6.1 SP2, on Solaris 8 and accessing an Oracle 9i db. We
    are using the Type 4 (Thin) driver and JProbe reports that hundreds of
    oracle.jdbc.* objects are left on the heap after my test case
    completes. Specifically oracle.jdbc.ttc7.TTCItem is the most common
    loiterer on the heap. I have verified that after each database access
    the resources are release correctly (i.e. ResultSet, Connection,
    PreparedStatement, etc.)
    Has anyone encountered similar problems? or does anyone know how to
    fix this?
    Thanks,
    Tim Watson

  • Memory Leak with Oracle ODBC Driver for Long Raw columns

    Oracle version : 8.1.7
    Platform : Win2K
    Oracle ODBC Driver version : 8.0.1.7.5.0.0
    Hi,
    I've got an Oracle database upgraded from
    V8.0.5 to V8.1.7 which has a table having one long raw +
    normal columns. I was able to observe distinct memory
    leaks (approx 80K) when using ODBC interface calls (thro C++ code) that referenced a combination of normal & long raw columns in a select statement. However, this leak was not observed when only normal columns were present in the
    select statement. Is there any known restriction for using
    long raw columns with other columns? Or do long raw columns have a known memory leak problem thro ODBC?
    Thanks!
    Regards
    Sanchayan

    Did you ever get an answer on this issue?
    Thanks in advance

  • Memory leak using Oracle ODBC connection. Works perfect with MSSQL.

    Hello,
    what could cause memory leaks which is not persistent. Sometimes in different OS and sometimes in different hardware. the common player to my issue is only with oracle.

    A memory leak that is not persistent is not a memory leak.
    You'll have to be way more specific for a more meaningful answer.
    Have you tried memory profiling tools for your operating system to locate the "leak"?
    Yours,
    Laurenz Albe

  • Possible memory leak in Oracle 12.1.0 C client

    Dear Oracle Users and Professionals,
    I want to report Oracle 12.1.0 C client memory leak when reconnect feature is on place. I have used Valgrind/massif tool to diagnostic our components and there was small memory leak in libclntsh.so.12.1 which is calling libc function getaddrinfo(). This seems to be not freed when connection is closed, but my application is still running and keep reconnect when needed.
    I sought a bit on internet and Oracle Portals about this and did not find any information that some has detected this particular issue.
    In the attachment is trace back from massif: comparison of two different time slots.
    We are developers and use only free available Oracle client versions. Our customer which will operate the system has available whole Oracle Support.
    If you can give me advice, to reach state where we will have no memory leak, it would be helpfull.
    Thank you very much
    Jan Kianicka
    ([email protected])

    Hi Jan,
        This forum is for questions about connecting to non-Oracle databases. For questions about the Oracle client connecting to Oracle databases then try either one of these forums - I am not sure which will be best -
    ODBC
    or
    General Database Discussions
    Regards,
    Mike

  • I am experiencing a memory leak when I write to a file in a loop.

    I am conducting a cycling test, each cycle represents about 48k of memory. I collect a selectable number of cycles into a shift register. When the chosen number of cycles is reached, I write the data to text files and then clear out the shift register. Unfortunately, I do not free up any memory space when this happens. I have been able to isolate the memory leak to the file writing function. I thought I was closing the reference when I closed the file, but apparently that is not happening. What space I free up by clearing the buffer, is cancelled by the memory required to make a reference to the file (I am guessing). This is all happening in a loop that must run as many as 500,000 times. Ideally, I
    would like to write as many as 1500 records at a time. At this point the memory leak makes this almost impossible. I have ordered some more memory, but I would rather plug the leak. I have read that LabView leaves a reference open to the file even after the file is closed. What can I do to clear the memory used up by leaving the reference open? Any insights would be very appreciated.

    The behaviour you describe is strange. Something to try: Open a refernce to the file one time before entering the loop, then inside the loop use that reference to do all the writing. Finally close the reference when the loop completes.If this doesn't work, post your code in 6.0 format and I'll be glad to look at it.Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Memory leak in weblogic 6.0 sp2 oracle 8.1.7 thin driver

    Hi,
         I have a simple client that opens a database connection, selects from
    a table containing five rows of data (with four columns in each row)
    and then closes all connections. On running this in a loop, I get the
    following error after some time:
    <Nov 28, 2001 5:57:40 PM GMT+06:00> <Error> <Adapter>
    <OutOfMemoryError in
    Adapter
    java.lang.OutOfMemoryError
    <<no stack trace available>>
    >
    <Nov 28, 2001 5:57:40 PM GMT+06:00> <Error> <Kernel> <ExecuteRequest
    failed
    java.lang.OutOfMemoryError
    I am running with a heap size of 64 Mb. The java command that runs
    the client is:
    java -ms64m -mx64m -cp .:/opt/bea/wlserver6.0/lib/weblogic.jar
    -Djava.naming.f
    actory.initial=weblogic.jndi.WLInitialContextFactory
    -Djava.naming.provider.url=
    t3://garlic:7001 -verbose:gc Test
    The following is the client code that opens the db connection and does
    the select:
    import java.util.*;
    import java.sql.*;
    import javax.naming.*;
    import javax.sql.*;
    public class Test {
    private static final String strQuery = "SELECT * from tblPromotion";
    public static void main(String argv[])
    throws Exception
    String ctxFactory     = System.getProperty
    ("java.naming.factory.initial");
    String providerUrl     = System.getProperty
    ("java.naming.provider.url");
    Properties jndiEnv          = System.getProperties ();
    System.out.println ("ctxFactory : " + ctxFactory);
    System.out.println ("ProviderURL : " + providerUrl);
    Context ctx     = new InitialContext (jndiEnv);
    for (int i=0; i <1000000; i++)
    System.out.println("Running query for the "+i+" time");
    Connection con = null;
    Statement stmnt = null;
    ResultSet rs     = null;
    try
    DataSource ds     = (DataSource) ctx.lookup
    (System.getProperty("eaMDataStore", "jdbc/eaMarket"));
    con = ds.getConnection ();
    stmnt = con.createStatement();
    rs = stmnt.executeQuery(strQuery);
    while (rs.next ())
    //System.out.print(".");
    //System.out.println(".");
    ds = null;
    catch (java.sql.SQLException sqle)
    System.out.println("SQL Exception : "+sqle.getMessage());
    finally
    try {
    rs.close ();
    rs = null;
    //System.out.println("closed result set");
    } catch (Exception e) {
    System.out.println("Exception closing result set");
    try {
    stmnt.close ();
    stmnt = null;
    //System.out.println("closed statement");
    } catch (Exception e) {
    System.out.println("Exception closing result set");
    try {
    con.close();
    con = null;
    //System.out.println("closed connection");
    } catch (Exception e) {
    System.out.println("Exception closing connection");
    I am using the Oracle 8.1.7 thin driver. Please let me know if this
    memory leak is a known issue or if its something I am doing.
    thanks,
    rudy

    Repost in JDBC section ... very serious issue but it may be due to Oracle or
    to WL ... does it happen if you test inside WL itself?
    How many iterations does it take to blow? How long? Does changing to a
    different driver (maybe Cloudscape) have the same result?
    Peace,
    Cameron Purdy
    Tangosol Inc.
    << Tangosol Server: How Weblogic applications are customized >>
    << Download now from http://www.tangosol.com/download.jsp >>
    "R.C." <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I have a simple client that opens a database connection, selects from
    a table containing five rows of data (with four columns in each row)
    and then closes all connections. On running this in a loop, I get the
    following error after some time:
    <Nov 28, 2001 5:57:40 PM GMT+06:00> <Error> <Adapter>
    <OutOfMemoryError in
    Adapter
    java.lang.OutOfMemoryError
    <<no stack trace available>>
    >
    <Nov 28, 2001 5:57:40 PM GMT+06:00> <Error> <Kernel> <ExecuteRequest
    failed
    java.lang.OutOfMemoryError
    I am running with a heap size of 64 Mb. The java command that runs
    the client is:
    java -ms64m -mx64m -cp .:/opt/bea/wlserver6.0/lib/weblogic.jar
    -Djava.naming.f
    actory.initial=weblogic.jndi.WLInitialContextFactory
    -Djava.naming.provider.url=
    t3://garlic:7001 -verbose:gc Test
    The following is the client code that opens the db connection and does
    the select:
    import java.util.*;
    import java.sql.*;
    import javax.naming.*;
    import javax.sql.*;
    public class Test {
    private static final String strQuery = "SELECT * from tblPromotion";
    public static void main(String argv[])
    throws Exception
    String ctxFactory = System.getProperty
    ("java.naming.factory.initial");
    String providerUrl = System.getProperty
    ("java.naming.provider.url");
    Properties jndiEnv = System.getProperties ();
    System.out.println ("ctxFactory : " + ctxFactory);
    System.out.println ("ProviderURL : " + providerUrl);
    Context ctx = new InitialContext (jndiEnv);
    for (int i=0; i <1000000; i++)
    System.out.println("Running query for the "+i+" time");
    Connection con = null;
    Statement stmnt = null;
    ResultSet rs = null;
    try
    DataSource ds = (DataSource) ctx.lookup
    (System.getProperty("eaMDataStore", "jdbc/eaMarket"));
    con = ds.getConnection ();
    stmnt = con.createStatement();
    rs = stmnt.executeQuery(strQuery);
    while (rs.next ())
    //System.out.print(".");
    //System.out.println(".");
    ds = null;
    catch (java.sql.SQLException sqle)
    System.out.println("SQL Exception : "+sqle.getMessage());
    finally
    try {
    rs.close ();
    rs = null;
    //System.out.println("closed result set");
    } catch (Exception e) {
    System.out.println("Exception closing result set");
    try {
    stmnt.close ();
    stmnt = null;
    //System.out.println("closed statement");
    } catch (Exception e) {
    System.out.println("Exception closing result set");
    try {
    con.close();
    con = null;
    //System.out.println("closed connection");
    } catch (Exception e) {
    System.out.println("Exception closing connection");
    I am using the Oracle 8.1.7 thin driver. Please let me know if this
    memory leak is a known issue or if its something I am doing.
    thanks,
    rudy

  • Memory leak issue with link server between SQL Server 2012 and Oracle

    Hi,
    We are trying to use the linked server feature with SQL Server 2012 to connect SQL server and Oracle database. We are concerned about the existing memory leak issue.  For more context please refer to the link.
    http://blogs.msdn.com/b/psssql/archive/2009/09/22/if-you-use-linked-server-queries-you-need-to-read-this.aspx
    The above link talks about the issues with SQL Server versions 2005 and 2008, not sure if this is still the case in 2012.  I could not find any article that talks about if this issue was fixed by Microsoft in later version.
    We know that SQL Server process crashes because of the third-party linked server provider which is loaded inside SQL Server process. If the third-party linked server provider is enabled together with the
    Allow inprocess option, the SQL Server process crashes when this third-party linked server experiences internal problems.
    We wanted to know if this fixed in SQL Server 2012 ?

    So your question is more of a information type or are you really facing OOM issue.
    There can be two things for OOM
    1. There is bug in SQL Server which is causing the issue which might be fixed in 2012
    2. The Linked server provider used to connect to Oracle is not upto date and some patch is missing or more recent version is to be used.  Did you made sure that you are using latest version.
    What is Oracle version you are trying to connect(9i,10g, R2...)
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • Oracle 8.1.5 Linux Memory Leak?

    We have been running Oracle 8.1.5 Server and Client on Redhat 6.1
    kernel 2.2.12-20
    glibc-2.1.2-11
    Blackdown's JDK 1.2 RC3
    We are having bad memory leaks and we have verified that they are
    not in our source code using a memory profiler for Java-linux.
    We are using the JDBC calls and the OCI JDBC driver.
    We think that the memory leak is in libocijdbc8.so but we're not
    sure. It could also be in glibc but the 2.1.2-11 version should
    be pretty stable. It could also be in the Blackdown jvm.
    Anyone have any ideas?
    null

    Oracle8iR2's JDBC works fine with Oracle8.1.5.
    You can download the new JDBC driver.
    null

  • Oracle JDBC Thin Driver Memory leak in scrollable result set

    Hi,
    I am using oracle 8.1.7 with oracle thin jdbc driver (classes12.zip) with jre 1.2.2. When I try to use the scrollable resultset and fetch records with the default fetch size, I run into memory leaks. When the records fetched are large(10000 records) over a period of access I get "outofmemory" error because of the leak. There is no use increasing the heap size as the leak is anyhow there.
    I tried using optimizeit and found there is a huge amout of memory leak for each execution of scrollable resultsets and this memory leak is propotional to the no of records fetched. This memory leak is not released even when i set the resultset,statement objects to null. Also when i use methods like scrollabelresultset.last() this memory leak increases.
    So is this a problem with the driver or i am doing some wrong.
    If some of you can help me with a solution to solve this it would be of help. If needed i can provide some statistics of these memory leaks using optimize it and share the code.
    Thanks
    Rajesh

    This thread is ancient and the original was about the 8.1.7 drivers. Please start a new thread. Be sure to include driver and database versions, stack traces, sample code and why you think there is a memory leak.
    Douglas

  • Avoid Bug 7146375 ORA-4030 MEMORY LEAK IN (Xml generation) in oracle 10g

    Hi All,
    I have to generate an xml from database which contains around 4 lac records. I had written a query using XmlSerialize and XmlElement.
    It does run properly for records less than 2 lacs.
    But when the record count goes above 2 lacs..it is throwing the following error -
    { ORA-04030: out of process memory when trying to allocate 1032 bytes (qmxlu subheap,qmemNextBuf:alloc)
    ORA-06512: at "SYS.XMLTYPE", line 111!}
    For the above error - I have tried increasing pga from 480M to 800M, but still we are getting the same error.
    After researching i found out -
    Cause
    This is caused by the following bug:
    Bug 7146375 ORA-4030 AND MEMORY LEAK IN SESSION HEAP: "KOH DUR HEAP D"
    Solution
    Bug 7146375 is fixed in 11.2
    So i tried out the query in another a db which has 11g installed and my query runs perfectly fine for records of upto 4 lacs.
    But since we have oracle 10g on our clients machine, are there other ways to achieve this XML generation other than this?
    Thanks.

    913389 wrote:
    After researching i found out -
    Cause
    This is caused by the following bug:
    Bug 7146375 ORA-4030 AND MEMORY LEAK IN SESSION HEAP: "KOH DUR HEAP D"
    Solution
    Bug 7146375 is fixed in 11.2
    So i tried out the query in another a db which has 11g installed and my query runs perfectly fine for records of upto 4 lacs.
    But since we have oracle 10g on our clients machine, are there other ways to achieve this XML generation other than this?I doubt it. If Oracle have investigated and created a bug report that says the solution is to upgrade to 11.2, then that's the answer, otherwise they would indicate that a particular 10g patch set can also be used.

  • Oracle 9.2 and memory leak detection

    Hi All.
    I have found the following error in trace file
    after shutdown database.
    =================================================================
    /.../udump/cpaw_ora_4427.trc
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    ORACLE_HOME = /.../product/9.2.0
    System name: Linux
    Node name: host.com
    Release: 2.4.18-10bigmem
    Version: #1 SMP Wed Aug 7 10:26:52 EDT 2002
    Machine: i686
    Instance name: orcl
    Redo thread mounted by this instance: 0 <none>
    Oracle process number: 10
    Unix process pid: 4427, image: [email protected] (TNS V1-V3)
    *** SESSION ID:(9.3) 2002-10-10 14:17:14.265
    Archiving is disabled
    Archiving is disabled
    ******** ERROR: SGA memory leak detected 16 ********
    KGH Latch Directory Information
    ldir state: 2 next slot: 39
    Slot [  1] Latch: 0x50005be8 Index: 1 Flags: 3 State: 2 next: (nil)
    <...>
    =====================================================================
    Linux RedHat 7.3 (db works in archivelog mode).
    How can I correct this?
    Thanks in advance.
    Best regards,
    Andrey Demchenko.

    Thanks for the answers. The oci8.dll is uncommented naturally. Otherwise it would start up just fine, but I couldn't use the database functions.
    I got it working by installing 5.1.6, but replacing the oci8.dll with the one from the 5.1.0 -version. It's a very... desperate... solution, but at least it works.
    I'm gonna have to try to sell the idea of using the 10g client to our DBA. I don't think though, that he'll be very enthusiastic to set it up on our production servers. We'll see.

  • Memory Leak - Oracle 9.2 ADO/OLE DB Select Distinct

    I'm using ADO (MDAC 2.8) and Oracle OLE DB (9.2.0.1.0) to access an Oracle 9.2.0.1.0 database. All queries run fine, but when I issue a query with the distinct keyword (e.g. Select distinct...), the application leaks memory. The memory leak does not occur when issuing the same query to MS SQL Server 2000. I also installed the latest 9.2.0.2.0 Oracle OLE DB update, but it didn't fix the problem.
    The same problem appears to have been fixed with Oracle ODBC drivers. "Fixed memory leak when using �select distinct�. (Bug2685365)"
    http://otn.oracle.com/software/tech/windows/odbc/htdocs/whatsnew.htm
    I've also seen the same problem reported on DBForums.com.
    "...select distinct query made through ADO causes a memory leak in that object... This issue is known by Oracle and I think that there may be a patch available for Oracle 9."
    http://dbforums.com/arch/210/2003/3/733498
    This is a critical problem for the product we are developing.
    Is there a fix available for this problem?
    Bob

    Thanks, I looked for the update yesterday, but all Oracle had posted was the update for 9.2.0.2.0.
    Luckily, as of this morning there is a new update available from Oracle, 9.2.0.4.0. I installed it and it fixed the memory leak with OLE DB and Select Distinct queries.
    The installer for 9.2.0.4.0 is a bit rough. It doesn't stop the Distributed Transaction Coordinator or Oracle MT Service on your computer, so you must stop them before installing. Also, you can't install all the products at once and must install the Oracle uninstaller first.

Maybe you are looking for