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 (




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