Subject Re: [Firebird-Java] How to make the garbage collector collect
Author Markus Plail
"Roman Rokytskyy" <rrokytskyy@...> writes:
>>> 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.
>
> Can you provide an example of this situation? It should not happen :)

Not easily. It's 8 DB and different queries along some of them. It just
seems to be many PreparedStatements, which can't be reused.

I now setMaxStatements(0) but after inserting 30 entries I still have
600 XSQLVARs floating around. Inserting an entry looks like that:

DB1: select
DB2: select (2x from different tables)
DB3: select
DB4: select
DB5: select (exists object?) insert/update
DB6: select (exists object?) insert/update

Everything is done via PreparedStatements. All queries look like that:
select attr1, ... , attr1 from tablename where ....
-> simple queries, nothing fancy. insert/updates look likewise.
I modified XSQLVAR/AbstractPreparedStatement to count the number of
objects in memory and log when an instance is created/finalized.

regards
Markus