🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.replication
Article #122

memory leak

#122
From: David Meng
Date: Wed, 17 Dec 2003 17:35
44 lines
2351 bytes
Hi,

I am using interbase 7, I have a Java client retriving data from interbase
using JDBC connection pool, however I got memory leak problem. When tracing
the problem in Optimizeit, it pointed to:
interbase.interclient.lscStmtHandle which hold a lot of references to
java.util.ArrayList object that can't be garbage collected. Does anyone have
any idea about this problem, thanks for your help.

Here is the sample code I used:

          Statement stmt = null;
          ResultSet rst = null;
          Connection conn = null;

          try {
                  conn = connectionPool.getConnection();
                  stmt = conn.createStatement();
                  rst = stmt.executeQuery(sql);
                  if (rst.next())
                  {
                    result = rst.getString(columnName);
                  }
          }
          catch (SQLException e) {
            e.printStackTrace();
            throw e;
          }
          finally {
                  if (rst != null) {
                          try {rst.close();}catch(Exception e) {}
                          rst = null;
                  }
                  if (stmt != null) {
                          try {stmt.close();}catch(Exception e) {}
                          stmt = null;
                  }
                  if (conn != null) {
                    connectionPool.freeConnection(conn);
                  }
          }

Regards,
David Meng
Technical Details
Message-ID: <3fe093e9@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f89d7,370ec27bd08b42b5,start
X-Google-Attributes: gidf89d7,public
X-Google-ArrivalTime: 2003-12-17 09:40:15 PST
Reply-To: "David Meng" <dmeng@borland.com>
From: "David Meng" <dmeng@borland.com>
Newsgroups: borland.public.interbase.replication
Subject: memory leak
Date: Wed, 17 Dec 2003 12:35:45 -0500
Lines: 46
Organization: Borland Canada
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 143.186.114.183
Message-ID: <3fe093e9@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1071682537 143.186.114.183 (17 Dec 2003 09:35:37 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail