OutOfMemoryExceptions Using Oracle JDBC 10.2 Drivers and Statement Caching Due to PreparedStatement and CallableStatement Holding char[] Buffers (Doc ID 1082118.1)

Last updated on MARCH 08, 2017

Applies to:

JDBC - Version 10.2.0.3 to 10.2.0.4 [Release 10.2]
Information in this document applies to any platform.

Symptoms


Using JDBC driver 10.2.0.3 in a J2EE application, preparedStatement continuously takes memory from the total heap, causing outofmemory errors.
Looking at the heap dump, the majority seems to be occupied by char[] arrays:

Total heap size: 805,304,832 bytes (almost to the -Xmx value of 768MB)
Total char[] size: 569,319,826 bytes with 638,443 instances.
Total String instances: 636,355

There are about 875 char[] array of 586,376 bytes. All these arrays are coming from "oracle.jdbc.driver.T4CCallableStatement" class instances, with an instance count of 890.


The issue occurs when using Statement Caching.

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