Re: Postgres using more memory than it should - Mailing list pgsql-performance

From Bill Moran
Subject Re: Postgres using more memory than it should
Date
Msg-id 20081203111430.b794be92.wmoran@collaborativefusion.com
Whole thread Raw
In response to Postgres using more memory than it should  (Matthew Wakeling <matthew@flymine.org>)
List pgsql-performance
In response to Matthew Wakeling <matthew@flymine.org>:
>
> Hi. I have a problem on one of our production servers. A fairly
> complicated query is running, and the backend process is using 30 GB of
> RAM. The machine only has 32GB, and is understandably swapping like crazy.
> My colleague is creating swap files as quickly as it can use them up.
>
> The work_mem setting on this machine is 1000MB, running Postgres 8.3.0.

If your query it dealing with a lot of data, it could easily use 1G per
sort operation.  If there are a lot of sorts (more than 32) you'll end
up with this problem.

1G is probably too much memory to allocate for work_mem.

--
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

wmoran@collaborativefusion.com
Phone: 412-422-3463x4023

****************************************************************
IMPORTANT: This message contains confidential information and is
intended only for the individual named. If the reader of this
message is not an intended recipient (or the individual
responsible for the delivery of this message to an intended
recipient), please be advised that any re-use, dissemination,
distribution or copying of this message is prohibited. Please
notify the sender immediately by e-mail if you have received
this e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The
sender therefore does not accept liability for any errors or
omissions in the contents of this message, which arise as a
result of e-mail transmission.
****************************************************************

pgsql-performance by date:

Previous
From: Matthew Wakeling
Date:
Subject: Postgres using more memory than it should
Next
From: tv@fuzzy.cz
Date:
Subject: Re: Postgres using more memory than it should