My Oracle Support Banner

Server Memory Leak When Using Connection Cache And Queries On XMLType Objects. (Doc ID 557989.1)

Last updated on MARCH 08, 2017

Applies to:

JDBC - Version: to 11.1
This problem can occur on any platform.


Find that running a query "select sys_xmlgen(1) from dual" from a java program using a JDBC driver with the connection cache enabled,  results in the database process consuming more and more memory for every iteration until it crashed .

Your java code looks like:

      OracleDataSource ods = new OracleDataSource();
      ods.setURL("jdbc:oracle:thin:@" + url );

      // Retrieve connection.
      Connection conn = ods.getConnection(); 

      // Iterate to show database memory increasing.
      int i = 0;
      boolean b = true;
      while (b)
        conn = ods.getConnection(); 

        String sql = "select sys_xmlgen(1) from dual "; 

        OracleCallableStatement st = (OracleCallableStatement)conn.prepareCall(sql);
        ResultSet results = st.executeQuery();

        int rowCount = 0;
        while (




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

This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process, and therefore has not been subject to an independent technical review.

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