Server Memory Leak When Using Connection Cache And Queries On XMLType Objects.
(Doc ID 557989.1)
Last updated on MARCH 13, 2019
Applies to:
JDBC - Version 10.1.0.4 to 11.1.0.6 [Release 10.1 to 11.1]Information in this document applies to any platform.
This problem can occur on any platform.
Symptoms
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 );
ods.setUser("<USERNAME>");
ods.setPassword("<PASSWORD>");
ods.setConnectionCachingEnabled(true);
// Retrieve connection.
Connection conn = ods.getConnection();
// Iterate to show database memory increasing.
int i = 0;
boolean b = true;
while (b)
{
i++;
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 (results.next())
{
rowCount++;
}
results.close();
st.close();
conn.close();
}
...
Changes
Cause
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
Symptoms |
Changes |
Cause |
Solution |
References |