Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Memory Leaks

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...
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!