Subject Re: [Firebird-Java] Memory Leek with Statement Pooling
Author Carsten Schäfer
Carsten Schäfer wrote:
> "Roman Rokytskyy" wrote:
>>> Are the statements released ever ?
>>
>> Statement cannot live longer than connection. In worst case they are
>> released when connection is closed. In normal case application closes
>> them right after the use. When statement pooling is used they are not
>> released until connection is closed. Even more, there is a limit on
>> open statement handles in Firebird (something ~20,000). Uncontrolled
>> statement pooling might exaust Firebird.
>>
>
> I have done some more testing.
> I use dataSource.setMinPoolSize(0);
> and dataSource.setMaxIdleTime(10000);
> so that after ten seconds connection and statements should be
> released. But the memory usage is still climbing.
> Not for every call of my report, but very often.
> If i use setStatementPooling(false) memory usage is never climbing
> for this report,
> so i think there must be a leak somewhere in pooling.
>


I've done some more tests with Jaybird 1.5.2, but the problem with statement
pooling still exists.
My profiler says that most of memory growing are Strings and char[] and
org.firebirdsql.gds.XSQLVAR and org.firebirdsql.jdbc.FBPrepredStatement and
org.firebirdsql.jdbc.field.FBDateField and HashMap$Entry[] and
LinkedList$Entry Objects.
Most of these objects are created within the driver and are not released
after the connection is released.

mfg
Carsten