Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iWiI6-0007iM-Vz for pgsql-performance@arkaria.postgresql.org; Mon, 18 Nov 2019 14:46:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iWiI5-00076n-G9 for pgsql-performance@arkaria.postgresql.org; Mon, 18 Nov 2019 14:46:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iWiI5-00076g-6T for pgsql-performance@lists.postgresql.org; Mon, 18 Nov 2019 14:46:09 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iWiI2-00087U-QZ for pgsql-performance@lists.postgresql.org; Mon, 18 Nov 2019 14:46:08 +0000 Received: by mail-wr1-x42b.google.com with SMTP id e6so19842309wrw.1 for ; Mon, 18 Nov 2019 06:46:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zunibal-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=lh85h9A+AWp/0/lBrmQptJFAmKk1hd6U/PRvG+EiFVM=; b=fhubcZiewREPK32oMy1xxTwkIr/3xx2sMIvvIjpBYy+QMZQTYUOJACXoslwrUiwFa2 NwP50MJeenT36DW4ivaqgEgoztDaPUsIMkYufn02hWIUjPt+Jlg5XlYvyuS7kE9G5mHg vbo0/3pYcv+jtypOrZm77BMRKQGksLgACKruE8ECkv/0osD6IILmxIqOYoQC0gG3sjYz x5JDkFz10rVPljxdhEep0b/fDGsCWM4t5zyMuFCH5uEDDcbVDsWTgtzWuWJXDb4oFwS5 7c6/lvxtsLeXbF938AVFmsiNoUPBUvqwYG9JR+RvxGL+x1x0hzuQhAVNFd/Ndf5eKI88 Fd9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=lh85h9A+AWp/0/lBrmQptJFAmKk1hd6U/PRvG+EiFVM=; b=ffdgd93+Uu5dWYwPoTdCjvg2kKjV/EvU9SnO1jCOSgi8QkjC+XJXQtZwIIMen+7Dgn ZTWbJxUk/TlzBvRPn8ne4+GIxWodMA/ORbG7MZTQqSp0JFXwjKWOzx8Yy2c12A50atBF NnSKnJu5qEqoxMq8KahUog8AmyWUxXeEBkNePJc6f1iz0YTbKm3qNhj/zSja0rZKjXXy aHmyPWgZY516iT0pcVlht6f+hhzf9NTIKhUmMlbVqkQxSJ1BslysBj9ezDpcI/JX351q mx9W8LBVzA91j5S9V4dXkFgQToQ1YG3jrZr4pyJVSqRkqvGtWQtz44sFuG2toRMi8p0e cpxA== X-Gm-Message-State: APjAAAXvXRtGLd7STaCeL0ai/eEQzezeDJ3XoiTADwEuVKQN88jFHA/e 5rIAxUqnsGiXU3sMkh6n+llJiLwGzlo= X-Google-Smtp-Source: APXvYqylVb030CTX9fn1TJChj2p8fTKHtPhCilVRi9UOfWGDFlHIWlgpeIB8Kk7VJVIpgHHBfU2kMA== X-Received: by 2002:adf:db86:: with SMTP id u6mr8098453wri.318.1574088365357; Mon, 18 Nov 2019 06:46:05 -0800 (PST) Received: from [192.168.3.150] ([176.222.91.85]) by smtp.gmail.com with ESMTPSA id j67sm21709866wmb.43.2019.11.18.06.46.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Nov 2019 06:46:04 -0800 (PST) Subject: Re: Out of memory error on automatic vacuum To: Tomas Vondra Cc: pgsql-performance@lists.postgresql.org References: <20191118122528.45k3jpgaxevsyser@development> <20191118141605.4mmynff64c5prxgf@development> From: Ekaterina Amez Message-ID: Date: Mon, 18 Nov 2019 15:46:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191118141605.4mmynff64c5prxgf@development> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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). Thanks for your time.