Memory Not Released Using registerIndexTableOutParameter on OracleCallableStatement (Doc ID 1117399.1)

Last updated on AUGUST 03, 2016

Applies to:

JDBC - Version 10.2.0.1 to 11.2.0.2.0 [Release 10.2 to 11.2]
Information in this document applies to any platform.

Symptoms

When using the method registerIndexTableOutParameter on an OracleCallableStatement object, memory is not released in heap even after closing the OracleCallableStatement. 

For example, when using the following or similar code:
OracleConnection conn = (OracleConnection)DriverManager.getConnection("jdbc:oracle:thin:@hostname:1521:SID","username","password");
OracleCallableStatement stmt = (OracleCallableStatement) conn.prepareCall("{call MEMORY_LEAK3.Memory_Leak_Array(?)}");
stmt.registerIndexTableOutParameter(1, 20000, Types.VARCHAR, 30);
stmt.executeUpdate();
stmt.close();
stmt = null;
System.gc();


In the memory heap, char and byte arrays are not released. 
The byte arrays are referenced by T4Connection.all8.tmpBindsByteArray
The char arrays are referenced by T4Connection.all8.ibtBindchars

When using the Implicit Connection Cache, the byte arrays are freed after closing the Connection object, giving the connection back to the pool.  This does not occur when using third-party connection pooling mechanisms.

Changes

Use of registerIndexTableOutParameter

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