pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephan Knauss <pgsql@stephans-server.de>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Debugging leaking memory in Postgresql 13.2/Postgis 3.1
Date: Tue, 30 Mar 2021 14:46:21 -0400
Message-ID: <2919657.1617129981@sss.pgh.pa.us> (raw)
In-Reply-To: <9f73e655-14b8-feaf-bd66-c0f506224b9e@stephans-server.de>
References: <9f73e655-14b8-feaf-bd66-c0f506224b9e@stephans-server.de>

Stephan Knauss <pgsql@stephans-server.de> writes:
> The wiki suggested to dump MemoryContext states for more details, but 
> something strange happens when attaching gdb. It seems that the process 
> is immediately killed and I can no longer dump such details.

You might try running the postmaster under a restrictive ulimit
(I think the -v option is the one that matters on Linux, not -d
as you might guess).  The idea here is that the backends would
get an actual ENOMEM failure from malloc() before reaching the
point where the kernel's OOM-kill behavior takes over.  Given
that, they'd dump memory maps to stderr of their own accord,
and you could maybe get some insight as to what's leaking.
This'd also reduce the severity of the problem when it does
happen.

			regards, tom lane





view thread (8+ messages)  latest in thread

Message-ID: <2919657.1617129981@sss.pgh.pa.us>
Permalink:  ../2919657.1617129981@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2919657.1617129981@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, pgsql@stephans-server.de
  Subject: Re: Debugging leaking memory in Postgresql 13.2/Postgis 3.1
  In-Reply-To: <2919657.1617129981@sss.pgh.pa.us>
  References: <9f73e655-14b8-feaf-bd66-c0f506224b9e@stephans-server.de> <2919657.1617129981@sss.pgh.pa.us>

* 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