pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andy Colson <andy@squeakycode.net>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: pgsql <pgsql-general@postgresql.org>
Subject: Re: pg_dump out of memory
Date: Wed, 4 Jul 2018 09:38:04 -0500
Message-ID: <0d202a74-fed9-6818-557c-7cb2fc5fa22c@squeakycode.net> (raw)
In-Reply-To: <CAKJS1f-3TpWoUWKVzY=xVuFk269oPD7NAyuBarpZY8Hvz4KwZQ@mail.gmail.com>
References: <b87bd5fc-c78f-f225-ffcf-8029a1d55af3@squeakycode.net>
	<CAKJS1f-3TpWoUWKVzY=xVuFk269oPD7NAyuBarpZY8Hvz4KwZQ@mail.gmail.com>

On 07/04/2018 12:31 AM, David Rowley wrote:
> On 4 July 2018 at 14:43, Andy Colson <andy@squeakycode.net> wrote:
>> I moved a physical box to a VM, and set its memory to 1Gig.  Everything
>> runs fine except one backup:
>>
>>
>> /pub/backup# pg_dump -Fc -U postgres -f wildfire.backup wildfirep
>>
>> g_dump: Dumping the contents of table "ofrrds" failed: PQgetResult() failed.
>> pg_dump: Error message from server: ERROR:  out of memory
>> DETAIL:  Failed on request of size 1073741823.> pg_dump: The command was: COPY public.ofrrds (id, updateddate, bytes) TO
>> stdout;
> 
> There will be less memory pressure on the server if the pg_dump was
> performed from another host. When running pg_dump locally the 290MB
> bytea value will be allocated in both the backend process pg_dump is
> using and pg_dump itself. Running the backup remotely won't require
> the latter to be allocated on the server.
> 
>> I've been reducing my memory settings:
>>
>> maintenance_work_mem = 80MB
>> work_mem = 5MB
>> shared_buffers = 200MB
> 
> You may also get it to work by reducing shared_buffers further.
> work_mem won't have any affect, neither will maintenance_work_mem.
> 
> Failing that, the suggestions of more RAM and/or swap look good.
> 

Adding more ram to the vm is the simplest option.  I just seems a waste cuz of one backup.

Thanks all.

-Andy




view thread (7+ messages)

Message-ID: <0d202a74-fed9-6818-557c-7cb2fc5fa22c@squeakycode.net>
Permalink:  ../0d202a74-fed9-6818-557c-7cb2fc5fa22c@squeakycode.net/
Also on:    postgresql.org/message-id/0d202a74-fed9-6818-557c-7cb2fc5fa22c@squeakycode.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: andy@squeakycode.net, david.rowley@2ndquadrant.com
  Subject: Re: pg_dump out of memory
  In-Reply-To: <0d202a74-fed9-6818-557c-7cb2fc5fa22c@squeakycode.net>
  References: <b87bd5fc-c78f-f225-ffcf-8029a1d55af3@squeakycode.net> <CAKJS1f-3TpWoUWKVzY=xVuFk269oPD7NAyuBarpZY8Hvz4KwZQ@mail.gmail.com> <0d202a74-fed9-6818-557c-7cb2fc5fa22c@squeakycode.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox