Subject | Re: [Firebird-Java] How to make the garbage collector collect |
---|---|
Author | Markus Plail |
Post date | 2005-11-25T08:29:54Z |
"Roman Rokytskyy" <rrokytskyy@...> writes:
in my database, I have mor than 300000 XSQLVARs lying around and I am
getting short of heap space.
regards
Markus
>> I am writing webapps, that use Firebird databases. I have on db forVery good to know, thanks :-)
>> every service and wanted to know if there is any possibility to get
>> my XSQLVARs garbage collected other than to shutdown my
>> FBWrappingDataSource und create a new instance.
>
> By default pool has also statement pooling switched on. That means
> that even after closing the pooled connection, physical connection
> will reference prepared statements and ready for use. Set the
> "maxStatements" property to 0, it will switch the statement pooling
> off. In this case closing the prepared statement will also deallocate
> all structures incl. XSQLVAR and XSQLDA.
> But my question is: do they cause any troubles in your application?When there are hundreds of thousand, yes. After inserting 3000 entries
in my database, I have mor than 300000 XSQLVARs lying around and I am
getting short of heap space.
>> Btw. it's not possible to:A simple restart didn't free the XSQLVARs. I had to shutdown().
>> FBWrappingDataSource fbWrapDs = new FBWrappingDataSource();
>> fbWrapDs.setDatabase("//" + URL + ":" + PORT + "/" +
>> db = new Firebird(fbWrapDs.getConnection());
>> ... do smth ...
>> fbWrapDs.getConnection().close();
>> fbWrapDs.shutdown();
>> fbWrapDs.restart();
>
> If I'm not mistaken, simple restart() should be enough.
> But the NullPointerException is clear bug and should not beWill do so.
> there. Please fill a bug report, I will fix this in next point
> release.
regards
Markus