Re: out of memory woes

From: "Angva" <angvaw(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: out of memory woes
Date: 2006-12-20 15:25:15
Message-ID: 1166628315.373662.284680@48g2000cwx.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera wrote:
> That's not a problem because it's just a limit. It won't cause out of
> memory or anything.

Ah, I see. Well, it's nice to have caught that anyway, I suppose.

> The problem with work_mem is that the system may request that much
> memory for every Sort step. Each query may have more than one of those,
> and each backend can be serving more than one query at a time. So those
> 200000 you have quickly turn into the gigabytes and consume the whole of
> your RAM.
>
> If a Sort step requires more than work_mem for its work, it will go to
> disk -- but in a much faster way than what the kernel is able to do with
> swap. So whenever you are trading work_mem for swap, you are losing big
> time. You should decrease that figure.

Thanks for that bit of advice, Alvaro. I did not know that a work_mem
is allocated for each sort step. I will try lowering work_mem gradually
until it impacts performance.

Though even if this fixes my problem, I'm still bothered by swap never
being used. (Not that I expect you to come up with a magic answer for
me.)

Thank you,
Mark

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christian.Strobl 2006-12-20 15:28:32 citing postgresql?
Previous Message Magnus Hagander 2006-12-20 14:52:47 Re: windows - silent uninstall question