Re: VACUUM ANALYZE out of memory

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Michael Akinde <michael(dot)akinde(at)met(dot)no>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: VACUUM ANALYZE out of memory
Date: 2007-12-11 11:50:11
Message-ID: 20071211115011.GA27613@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
> -- John F Kennedy

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-12-11 12:41:10 Re: partitioned table query question
Previous Message Gregory Stark 2007-12-11 11:49:36 Re: WORM and Read Only Tables (v0.1)