[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pgsql-bugs
Subject:    [BUGS] Re: OutOfMemory hibernate scroll with 2M records | Postgresql 8.4
From:       Ankit Kumar <ankitk () xebia ! com>
Date:       2009-12-21 17:16:24
Message-ID: 4B2FAA98.5050302 () xebia ! com
[Download RAW message or body]

Hi Greg

Thanks for your response. Hibernate works well when I change the DB to 
SQL server but somehow the moment I point to Postgresql it start 
generating OutOfMemory. Is there some configuration at DB end to ensure 
it starts using the cursors.

See link: http://forum.springsource.org/archive/index.php/t-23170.html

Regards
Ankit

Greg Stark wrote:
> On Mon, Dec 21, 2009 at 12:54 PM, Ankit Kumar <ankitk@xebia.com> wrote:
>   
>> I am running a Criteria.scroll() on postgresql on a DB containing 2M
>> records. The memory keeps increasing and finally it generates an
>> OutOfMemoryException. Please can you advice how to fix this.
>>
>> Postgresql DB version: 8.4
>> Postgresql Driver Used: postgresql-8.4-701.jdbc4.jar
>>
>> Some forums do mention that "scroll" is slow on Postgresql.
>>
>> Is this a known issue or we need to do something specific to make scroll
>> work on Postgresql?
>>
>>
>> Exception StackTrace:
>> java.lang.OutOfMemoryError: Java heap space
>>
>>     
>
> This looks like a Java error, not a Postgres one. It looks like
> Hibernate is asking for the entire result set back from Postgres
> instead of using a scrollable cursor and is trying to hold it all in
> RAM. You should ask the Hibernate people if they plan to either spill
> to disk or use database-side cursors which certainly do if necessary.
>
>   

[Attachment #3 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<big><tt>Hi Greg <br>
<br>
Thanks for your response. Hibernate works well when I change the DB to
SQL server but somehow the moment I point to Postgresql it start
generating OutOfMemory. Is there some configuration at DB end to ensure
it starts using the cursors.<br>
<br>
See link: <a class="moz-txt-link-freetext" \
href="http://forum.springsource.org/archive/index.php/t-23170.html">http://forum.springsource.org/archive/index.php/t-23170.html</a><br>
 <br>
Regards<br>
Ankit<br>
</tt></big><br>
Greg Stark wrote:
<blockquote
 cite="mid:407d949e0912210550x39425bc6r2874ea4ad8400211@mail.gmail.com"
 type="cite">
  <pre wrap="">On Mon, Dec 21, 2009 at 12:54 PM, Ankit Kumar <a \
class="moz-txt-link-rfc2396E" \
href="mailto:ankitk@xebia.com">&lt;ankitk@xebia.com&gt;</a> wrote:  </pre>
  <blockquote type="cite">
    <pre wrap="">I am running a Criteria.scroll() on postgresql on a DB containing 2M
records. The memory keeps increasing and finally it generates an
OutOfMemoryException. Please can you advice how to fix this.

Postgresql DB version: 8.4
Postgresql Driver Used: postgresql-8.4-701.jdbc4.jar

Some forums do mention that "scroll" is slow on Postgresql.

Is this a known issue or we need to do something specific to make scroll
work on Postgresql?


Exception StackTrace:
java.lang.OutOfMemoryError: Java heap space

    </pre>
  </blockquote>
  <pre wrap=""><!---->
This looks like a Java error, not a Postgres one. It looks like
Hibernate is asking for the entire result set back from Postgres
instead of using a scrollable cursor and is trying to hold it all in
RAM. You should ask the Hibernate people if they plan to either spill
to disk or use database-side cursors which certainly do if necessary.

  </pre>
</blockquote>
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic