<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Calibri">Hello,<br>
<br>
I have a pl/java routine that does some complex calculations based on
database information, inserts it into another database table, and then
essentially does a select on itself to return a resultSet:<br>
<br>
public ResultSet getResultSet() throws SQLException {<br>
if(resid != null) {<br>
statement =
DriverManager.getConnection("jdbc:default:connection").createStatement();<br>
return statement.executeQuery("SELECT * FROM tblResult
WHERE ResultID = '" + resid + "'");<br>
}<br>
return null;<br>
}<br>
<br>
(resid is a class member variable, a UUID, and everything works fine).<br>
<br>
However, executing this nearly 1,000 times in an open session leads to
the postgres instance growing to nearly 1gb in memory usage. Clearly,
there is a memory leak somewhere, but I would think that the ResultSet
and its open connections would be gc'd once the class instance was no
longer used.<br>
<br>
So, I recoded the above to use a CachedResultSet, closed the connection
and statement, and the memory leak still persists. Is there a proper
way to use this that I'm not envisioning? Or have I run into a bug?<br>
<br>
Thanks,<br>
Lucas<br>
</font>
</body>
</html>