Re: out of memory during query execution - Mailing list pgsql-general

From Tom Lane
Subject Re: out of memory during query execution
Date
Msg-id 13416.1135179301@sss.pgh.pa.us
Whole thread Raw
In response to Re: out of memory during query execution  (DANTE ALEXANDRA <ALEXANDRA.DANTE@BULL.NET>)
List pgsql-general
DANTE ALEXANDRA <ALEXANDRA.DANTE@BULL.NET> writes:
> In my case, does this mean that each one of the two hashs and sorts will
> take 64MB, so 192MB ?
> What do you want to say with "so the two hashes and sort would think
> they could use 3/4ths of the available heap" ?

Right, exactly.  In this particular case I think the top-level sort is
not going to be using much memory because it won't see very many rows,
but potentially it could try to eat 64Mb just like each of the hashes.

Your log entries show that the hashes are actually eating over 100Mb
apiece.  The memory space estimation for work_mem is not completely
accurate, and is not intended to be, but I would have liked to think
it would be closer than a factor-of-2 error.  Might be worth looking
into exactly what's happening there.

> Last question, how can I see that my 32-bit AIX program being limited to
> 256MB of heap,

For that you need to talk to an AIX expert, which I'm not.

            regards, tom lane

pgsql-general by date:

Previous
From: DANTE ALEXANDRA
Date:
Subject: Re: out of memory during query execution
Next
From: Seneca Cunningham
Date:
Subject: Re: out of memory during query execution