Hi All -

I want to point out that the DRDA standard (Network Server and the client) as well as the JDBC standard needs to be referenced to dertermine what is 'proper' behavior. The Network layer (DRDA) has it's own optimizations and, in my experience, is the source of many 'memory leaks' because objects that are buffered in this layer are not freed for garbage collection unless the object are closed.
Hope this helps.

Wei Jiang wrote:

java.sql javadoc says:

Note: A Statement object is automatically closed when it is garbage collected.
When a Statement object is closed, its current ResultSet object, if one exists,
is also closed.

I do not close ResultSet. But I do close Statement. Is it possible that
when derby's Statement closed, the ResultSet is not?

I did forget to close one statement. After a while, Oracle's coneection automatically closed, so I found the problem and closed that statement after
use. Here, I am not trying to compare oracle with derby, but trying to say
that PROBABALY I close all Statement.



From: [EMAIL PROTECTED]

Wei Jiang <[EMAIL PROTECTED]> writes:

Hi,

I tried Derby using the default JDBC driver and found memory leak. When I use
Hsql or Oracle, I do not have such leak. So probably it is the JDBC driver.

Two things:

1) Are you closing your ResultSets? If just let the ResultSet objects
  pass out of scope without closing them, they will be "leaked". That
  is, the driver keeps a linked list of them so they won't be
  gc'ed. I have experienced this myself, but I don't know if there is
  a JIRA issue for it

2) Are you using blobs/clobs? From what I have seen on this (and the
  derby-dev) list, it seems that blobs/clobs cannot be streamed, and this
  can result in "Out of Memory" errors when using large blobs/clobs.


        
                
______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/



Reply via email to