From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Ekaterina Amez <ekaterina.amez@zunibal.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Out of memory error on automatic vacuum
Date: Mon, 18 Nov 2019 16:10:33 +0100
Message-ID: <20191118151033.jp7hctb3rl5jqynz@development> (raw)
In-Reply-To: <b5c70ce2-e1d8-dfe3-72b0-4164697db488@zunibal.com>
References: <a5c8d612-693e-1546-5cbf-6d928287bdc6@zunibal.com>
<20191118122528.45k3jpgaxevsyser@development>
<c59d5d5c-e629-22e4-851c-dd74f6d3c6ec@zunibal.com>
<20191118141605.4mmynff64c5prxgf@development>
<b5c70ce2-e1d8-dfe3-72b0-4164697db488@zunibal.com>
On Mon, Nov 18, 2019 at 03:46:03PM +0100, Ekaterina Amez wrote:
>
>El 18/11/19 a las 15:16, Tomas Vondra escribió:
>>
>>Not sure I understand. Whenever PostgreSQL process needs memory it
>>requests it from the kernel by calling malloc(), and the amount of
>>availabe RAM is limited. So when kernel can't provide more memory,
>>it returns NULL.
>>
>Understood.
>
>>
>>If it finished a couple of minutes before, it's unlikely to be the
>>related. But hard to say, without knowing the details.
>
>Yeah, I thought the same but for me is too much coincidence and is
>suspicious (or at least a thing to have in mind).
>
>
>>No, that's just one of the memory contexts (they form a tree), using
>>only 1kB of memory. What matters is the "grand total"
>>
>>Grand total: 1009356 bytes in 130 blocks; 436888 free (72 chunks);
>>572468 used
>>
>>which is ~1MB.
>>
>OK, in my lack of knowledge I was understanding "memory context" as
>the whole message.
>
>
>>Another thing you might do is adding a swap (if you don't have one
>>already), as a safety.
>>
>>
>Excuse my ignorance but... swap? You mean some mechanism that prevents
>server to be unavailable by having a second instance running but not
>accesible and changing from one to the other when the main fails?
>(It's the best way I find to describe it, as I don't usually
>speak/write english).
>
swap = space on disk, so that OS can page out unused data from RAM when
there's memory pressure
It's a basic sysadmin knowledge, I think. Search for mkswap.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tomas.vondra@2ndquadrant.com, ekaterina.amez@zunibal.com, pgsql-performance@lists.postgresql.org
Subject: Re: Out of memory error on automatic vacuum
In-Reply-To: <20191118151033.jp7hctb3rl5jqynz@development>
* 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