Subject Re: [Firebird-Java] Memory buildup
Author Claus Holst
We have found an explanation for the memory buildup.

First. It was not (only) the updates, but ordinary selects that made the buildup.

The problem is that all statements get saved in "isc_tr_handle_impl.stmts" on "executeQuery()".

This is done using "isc_tr_handle_impl.registerStatementWithTransaction(isc_stmt_handle stmt)".

They all get released doing commit using "isc_tr_handle_impl.forgetResultSets()".

I guess Statement.close() should clean itself from the list ?

Regards,
Claus


> > > We have upgraded from JayBird 1.5 to 1.5.3, and suddenly we
> > > encounter a memory-buildup.
> > >
> > > Memory will build up to aprox. 100mb while batch-updating aprox.
> > > 10,000 records in the same transaction.
> > >
> > > It is released again doing commit or rollback.
> > >
> > > The problem resides both in 1.5.3 and 1.5.4, whereas 1.5 performs
> > > flawlessly.
> > >
> > > I know this is too little information for bug-hunting, but we would
> > > like to know if this is a known problem ?, or even behavior as
> > > expected ?, before we start working on a test-case.
> >
> > Do you use FBConnectionPoolDataSource? Is statement pooling enabled?
> If both
> > answers are "yes", most likely you just cache all statements used in the
> > system. Try setting maxStatements to 0.
> >
> > If you obtain connection via DriverManager, then this most likely is
> a bug.
>
> We obtain the connection via DriverManager and use a homegrown
> connection pool.
>
> > Please send at least a code snippet to see where it happens.
> It is a bit complicated, so we will try to isolate the error first.
>
> We will come back to you, as soon as we have a test-case (or have found
> a bug in our code ;-) ).
>
> Thanks!
> Claus