My Oracle Support Banner

Exception in thread main "java.lang.OutOfMemoryError: Java heap space" Due to T4CStatement Objects (Doc ID 1073503.1)

Last updated on DECEMBER 01, 2017

Applies to:

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


An application fails with java.lang.OutOfMemoryError when it reuses the JDBC Callable Statement.
Memory heap analysis shows that objects of oracle.jdbc.driver.T2CCallableStatement occupy JVM space.

Error :

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
 at oracle.jdbc.driver.OracleSql.<init>(
 at oracle.jdbc.driver.OracleStatement.<init> (
 at oracle.jdbc.driver.T4CStatement.<init>(
 at oracle.jdbc.driver.T4CConnection.RefCursorBytesToStatement (
 at oracle.jdbc.driver.T4CTTIrxd.unmarshal(
 at oracle.jdbc.driver.T4CTTIrxd.unmarshal(
 at oracle.jdbc.driver.T4C8Oall.receive(
 at oracle.jdbc.driver.T4CCallableStatement.doOall8 (
 at oracle.jdbc.driver.T4CCallableStatement.executeForRows (
 at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout (
 at oracle.jdbc.driver.OraclePreparedStatement.executeInternal (
 at oracle.jdbc.driver.OraclePreparedStatement.executeQuery (
 at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(
 at MemoryLeak.main(


To view full details, sign in with your My Oracle Support account.

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

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.