Re: out of memory woes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Angva" <angvaw(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: out of memory woes
Date: 2006-12-17 20:09:25
Message-ID: 17733.1166386165@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Angva" <angvaw(at)gmail(dot)com> writes:
> Here is the sole plpgsql function that was called when the error
> occurred. This function is intended to be called from a shell script in
> order to cluster tables in parallel processes.

OK, I played around with this for a bit, and what I find is that in 8.1,
that SPIExec context is where the sort operation run by CLUSTER's
reindexing step allocates memory. So the short answer is "you've got
maintenance_work_mem set too high". I don't know why it sometimes fails
and sometimes not --- maybe you are reaching the swap-space limits of
the machine when you do several of these in parallel? But there doesn't
seem to be any actual leak here.

BTW, it's also the case that the 8.1 sort code isn't great about
measuring its space usage. I had maintenance_work_mem set to 100MB
and saw actual process size exceeding 200MB ... IIRC, that's been
improved in 8.2.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gene 2006-12-18 06:25:48 fedora core 6 startup script for pg 8.2
Previous Message Bob Pawley 2006-12-17 18:18:53 Creating an Application