Re: java.lang.OutOfMemoryError - Mailing list pgsql-jdbc

From Barry Lind
Subject Re: java.lang.OutOfMemoryError
Date
Msg-id 3E3FED75.4030709@xythos.com
Whole thread Raw
In response to java.lang.OutOfMemoryError  (Paul Cullum <pcullum@N-able.com>)
Responses Re: java.lang.OutOfMemoryError  (snpe <snpe@snpe.co.yu>)
List pgsql-jdbc
Paul,

A patch was just applied to cvs head to better deal with this.  The new
behavior is that by default you get the old behavior, but if you call
setFetchSize() it will turn on using cursors to incrementally fetch the
result.

thanks,
--Barry

PS.  I haven't yet got a new build for the web site, but should in a few
days, so in the meantime, if you want to try this out, you will need to
build from cvs sources.


Paul Cullum wrote:
> I'm querying a table that has nearly 3 million records in it and when I
> call executeQuery() I get an a java.lang.OutOfMemoryError message.  My
> immediate thought was that it was strange that a safe fetch size wasn't
> used automatically so I then I decided to explicitly the fetch size by
> calling the Connection classes setFetchSize() method.  Apparently this
> is not implemented in the pg73jdbc3.jar driver.   I am surprised that
> the default fetch size is so great as to cause an OutOfMemoryError. What
> is the proper method for using JDBC to query result sets which are
> potentially large?
>
> Thanks,
> Paul
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>




pgsql-jdbc by date:

Previous
From: Barry Lind
Date:
Subject: Re: problem with currency symbol in rs.getString
Next
From: Barry Lind
Date:
Subject: Re: 7.3 compability, select * from myfunc();