Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
    Bookmark Topic Watch Topic
  • New Topic

Memory Leaks  RSS feed

Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Report post to moderator
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 {
dbmd = m_conn.getMetaData();
rSet = dbmd.getPrimaryKeys(null, schema, table);
rsmd = rSet.getMetaData();
int columns = rsmd.getColumnCount();
while ( {
Log.logMsg(schema+"."+table+ " PKS: "+ rSet.getObject("COLUMN_NAME").toString(), Log.DEBUG);
primaryKeys = new String[pks.size()];
primaryKeys = pks.toArray();

} finally {
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.
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!