Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 1B13E633033 for ; Tue, 22 Dec 2009 03:53:13 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 63878-04 for ; Tue, 22 Dec 2009 07:53:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id A514C632FF8 for ; Tue, 22 Dec 2009 03:53:05 -0400 (AST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1NMzYD-0001Qy-RL for pgsql-jdbc@postgresql.org; Tue, 22 Dec 2009 08:53:01 +0100 Received: from ppp-93-104-21-24.dynamic.mnet-online.de ([93.104.21.24]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Dec 2009 08:53:01 +0100 Received: from spam_eater by ppp-93-104-21-24.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Dec 2009 08:53:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Re: OutOfMemory hibernate scroll with 2M records | Postgresql 8.4 DB Date: Tue, 22 Dec 2009 08:52:40 +0100 Lines: 11 Message-ID: References: <4B3047E7.9020901@xebia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ppp-93-104-21-24.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: <4B3047E7.9020901@xebia.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.74 tagged_above=-10 required=5 tests=BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 200912/86 X-Sequence-Number: 20167 Ankit Kumar wrote on 22.12.2009 05:15: > It appears the driver class is loading all entity objects in memory and > not releasing them as expected in a scroll operation. That's documented: http://jdbc.postgresql.org/documentation/84/query.html#query-with-cursor Just enable "query based retrieval" and the driver does not load everything into memory. Thomas