X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1A095D6E2C for ; Mon, 29 Aug 2005 16:09:45 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 69743-03 for ; Mon, 29 Aug 2005 19:09:42 +0000 (GMT) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6C704D7E0E for ; Mon, 29 Aug 2005 16:09:40 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1E9ovO-0007pk-Fd for pgsql-jdbc@postgresql.org; Mon, 29 Aug 2005 21:04:06 +0200 Received: from 213.244.29.170 ([213.244.29.170]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Aug 2005 21:04:06 +0200 Received: from Marc.Herbert by 213.244.29.170 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Aug 2005 21:04:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Marc Herbert Subject: Re: OutOfMemoryError Date: Mon, 29 Aug 2005 21:03:36 +0200 Lines: 24 Message-ID: <877je4o99z.fsf@meije.emic.fr> References: <1803896180418d.180418d1803896@nyroc.rr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 213.244.29.170 User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4 (Jumbo Shrimp, linux) Cancel-Lock: sha1:Mwux2fIrbT4JnJfTJrz4brqf3ag= X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.97 required=5 tests=[AWL=-0.635, FORGED_RCVD_HELO=0.05, RCVD_BY_IP=0.024, RCVD_NUMERIC_HELO=1.531] X-Spam-Level: X-Archive-Number: 200508/200 X-Sequence-Number: 13769 rstepha1@nycap.rr.com writes: > It seems that the ResultSet is containing the entire selected set of > data and not using a cursor within the database engine. I have tried > setting the resultSetType and resultSetConcurrency to TYPE_FORWARD_ONLY > and CONCUR_READ_ONLY respectively to hopefully force the cursor > management to be server oriented, without success. > > It is possible to work around by increasing the heap size or lowering > the selection criteria, but ... > > How do you get the driver to not retrieve all of the data into the > ResultSet? Is there a setting either within the JDBC driver, or at the > database that would determine caching X number of rows returned at a time? Try this: myStatement.setFetchSize(43); Warning: according to the JDBC spec, it's just a "hint", the driver may still do what it thinks is good.