Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
    Bookmark Topic Watch Topic
  • New Topic

Memory Leaks  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Report post to moderator
HI,
We are using Weblogic 6.1 as our application server.
We are using the java DataBaseMetaData object in order to figure out the Primary Keys on the underlying database tables. Here's the code from that method:
ResultSet rSet = null;
DatabaseMetaData dbmd = null;
ResultSetMetaData rsmd = null;
Object[] primaryKeys = null;
List pks = new ArrayList();
try {
establishDBConnection();
dbmd = m_conn.getMetaData();
rSet = dbmd.getPrimaryKeys(null, schema, table);
rsmd = rSet.getMetaData();
int columns = rsmd.getColumnCount();
while (rSet.next()) {
pks.add(rSet.getObject("COLUMN_NAME").toString());;
Log.logMsg(schema+"."+table+ " PKS: "+ rSet.getObject("COLUMN_NAME").toString(), Log.DEBUG);
}
primaryKeys = new String[pks.size()];
primaryKeys = pks.toArray();

} finally {
closeDBConnection();
}
return primaryKeys;
If we run this method several times it holds on to the Weblogic Server memory and never seems to garbage collect. We are closing the DB connection in the finally block. I didn't see any methods to close the DatabaseMetaData or the ResultSetMetaData.
Has anyone seen this behavior? Not sure what within this method is holding on to the Weblogic memory???
Any ideas/suggestions welcomed.
Thanks,
Deepali.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Report post to moderator
This particular forum isn't for questions about Java - rather, it's for questions and comments about JavaRanch. Your best bet would be to post this question in our JDBC forum instead. You will also need to register a valid user name to post there. Good luck...
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!