Re: BUG #1240: memory leak in JDBC driver build 215

From: Roland Walter <rwa(at)mosaic-ag(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1240: memory leak in JDBC driver build 215
Date: 2004-09-06 16:09:39
Message-ID: 413C8BC3.4040009@mosaic-ag.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Fabien COELHO schrieb:

>
>> 328 [main] DEBUG com.mosaicag.rwa.dbutil.standard.DefaultCsvExport -
>> executing SQL-Stmt: SELECT * FROM transaction WHERE transaction_date >=
>> to_timestamp('01.01.2002', 'DD.MM.YYYY') AND transaction_date <
>> to_timestamp('01.01.2003', 'DD.MM.YYYY')
>> java.lang.OutOfMemoryError
>> Exception in thread "main"
>
>
> Maybe the JDBC drivier tries to allocate the whole result of the query?
> If so, it is not a memory leak, it's a big memory need;-)
>
> You might try using a cursor manually (well, if it is the problem,
> then it just shows that jdbc should do it by default).

Using a cursor avoids the out of memory error. I used:

stmt.setFetchSize(1000);

after creation of the statement now.

Thanks, that helped. But for me this behaviour is still a bug.

--
Roland Walter
MOSAIC SOFTWARE AG
Telefon: 02225/882-411 Fax: 02225/882-201
http://www.mosaic-ag.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Fabien COELHO 2004-09-06 16:14:27 error in simple sql function breaks connection
Previous Message Fabien COELHO 2004-09-06 15:54:59 Re: BUG #1240: memory leak in JDBC driver build 215