Re: VACUUM ANALYZE out of memory - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: VACUUM ANALYZE out of memory
Date
Msg-id 20071211115011.GA27613@svana.org
Whole thread Raw
In response to Re: VACUUM ANALYZE out of memory  (Michael Akinde <michael.akinde@met.no>)
List pgsql-hackers
On Tue, Dec 11, 2007 at 12:30:43PM +0100, Michael Akinde wrote:
> The way the process was running, it seems to have basically just
> continually allocated memory until (presumably) it broke through the
> slightly less than 1.2 GB shared memory allocation we had provided for
> PostgreSQL (at least the postgres process was still running by the time
> resident size had reached 1.1 GB).

I think you're slightly confused. The VACUUM isn't going to use much of
the shared memory anyway. Shared memory is just disk buffers mostly and
is all allocated at startup. The memory being allocated by VACUUM is
the maintainence workmem *in addition* to any shared memory.

Also, depending on what's happening it may be allocating maintainence
workmem more than once.

> Incidentally, in the first error of the two I posted, the shared memory
> setting was significantly lower (24 MB, I believe). I'll try with 128 MB
> before I leave in the evening, though (assuming the other tests I'm
> running complete by then).

What you want is a reasonable shared mem, maybe 0.5GB and a smaller
maintainence workmem since the letter is probably what's killing you.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: VACUUM ANALYZE out of memory
Next
From: Gregory Stark
Date:
Subject: Re: partitioned table query question