Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k0ne2-0000YS-9w for pgsql-general@arkaria.postgresql.org; Wed, 29 Jul 2020 15:05:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k0ndz-0003B3-U6 for pgsql-general@arkaria.postgresql.org; Wed, 29 Jul 2020 15:05:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k0ndz-00035r-Lc for pgsql-general@lists.postgresql.org; Wed, 29 Jul 2020 15:05:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k0ndw-0003mu-C2 for pgsql-general@lists.postgresql.org; Wed, 29 Jul 2020 15:05:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 06TF5G8X1316851; Wed, 29 Jul 2020 11:05:16 -0400 From: Tom Lane To: "Daniel Westermann (DWE)" cc: "pgsql-general@lists.postgresql.org" Subject: Re: Out of memory with "create extension postgis" In-reply-to: References: ,<1183741.1595944647@sss.pgh.pa.us> ,<1193682.1595948121@sss.pgh.pa.us>, Comments: In-reply-to "Daniel Westermann (DWE)" message dated "Wed, 29 Jul 2020 14:49:02 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1316849.1596035116.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 29 Jul 2020 11:05:16 -0400 Message-ID: <1316850.1596035116@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "Daniel Westermann (DWE)" writes: > So this is what we got today. In the log file there is this: > 2020-07-29 16:33:23 CEST 101995 ERROR: =C2=A0out of memory > 2020-07-29 16:33:23 CEST 101995 DETAIL: =C2=A0Failed on request of size = 8265691 in memory context "PortalContext". > 2020-07-29 16:33:23 CEST 101995 STATEMENT: =C2=A0create extension postgi= s; Is there not a dump of memory context sizes just before the "ERROR: out of memory" line? It should look something like TopMemoryContext: 68720 total in 5 blocks; 17040 free (15 chunks); 51680 u= sed MessageContext: 8192 total in 1 blocks; 6880 free (1 chunks); 1312 used ... ErrorContext: 8192 total in 1 blocks; 7928 free (3 chunks); 264 used Grand total: 1063328 bytes in 190 blocks; 312376 free (159 chunks); 750952= used (this taken from an idle backend, so numbers from a backend that's hit OOM would be a lot larger). If you don't see that then you must be using some logging mechanism that fails to capture the postmaster's stderr output, such as syslog. If your postmaster start script doesn't actually send stderr to /dev/null, you might find the context map in some other log file. > The GDB session shows this: Umm ... you didn't issue a "bt" when you got to errfinish, so there's no useful info here. > Missing separate debuginfos, use: debuginfo-install CGAL-4.7-1.rhel7.1.x= 86_64 boost-date-time-1.53.0-27.el7.x86_64 boost-serialization-1.53.0-27.e= l7.x86_64 boost-system-1.53.0-27.el7.x86_64 boost-thread-1.53.0-27.el7.x86= _64 gmp-6.0.0-15.el7.x86_64 jbigkit-libs-2.0-11.el7.x86_64 json-c-0.11-4.e= l7_0.x86_64 libcurl-7.29.0-54.el7_7.2.x86_64 libidn-1.28-4.el7.x86_64 libj= peg-turbo-1.2.90-8.el7.x86_64 libssh2-1.8.0-3.el7.x86_64 libtiff-4.0.3-32.= el7.x86_64 mpfr-3.1.1-4.el7.x86_64 postgis30_12-3.0.1-5.rhel7.x86_64 proto= buf-c-1.0.2-3.el7.x86_64 sqlite33-libs-3.30.1-1.rhel7.x86_64 This is a little weird and scary; I would not expect most of those libraries to have gotten linked into a Postgres backend. What extensions are you using? (And what the devil would any of them want with sqlite or libcurl? boost-thread is even scarier, because we absolutely do not support multithreading in a backend process.) regards, tom lane