Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faiv6-0006HM-IA for pgsql-general@arkaria.postgresql.org; Wed, 04 Jul 2018 14:38:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1faiv5-0006lz-1V for pgsql-general@arkaria.postgresql.org; Wed, 04 Jul 2018 14:38:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faiv4-0006lr-MW for pgsql-general@lists.postgresql.org; Wed, 04 Jul 2018 14:38:10 +0000 Received: from squeakycode.net ([96.126.114.205]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faiv2-0000We-6r for pgsql-general@postgresql.org; Wed, 04 Jul 2018 14:38:09 +0000 Received: from rogue.localdomain (unknown [IPv6:2604:2d80:c02c:8776:73fd:68f7:78ac:c6b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: andy) by squeakycode.net (Postfix) with ESMTPSA id 766CE22842; Wed, 4 Jul 2018 09:38:07 -0500 (CDT) Subject: Re: pg_dump out of memory To: David Rowley Cc: pgsql References: From: Andy Colson Message-ID: <0d202a74-fed9-6818-557c-7cb2fc5fa22c@squeakycode.net> Date: Wed, 4 Jul 2018 09:38:04 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 07/04/2018 12:31 AM, David Rowley wrote: > On 4 July 2018 at 14:43, Andy Colson 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