Re: Debugging leaking memory in Postgresql 13.2/Postgis 3.1 - Mailing list pgsql-general

From Tom Lane
Subject Re: Debugging leaking memory in Postgresql 13.2/Postgis 3.1
Date
Msg-id 2919657.1617129981@sss.pgh.pa.us
Whole thread Raw
In response to Debugging leaking memory in Postgresql 13.2/Postgis 3.1  (Stephan Knauss <pgsql@stephans-server.de>)
Responses Re: Debugging leaking memory in Postgresql 13.2/Postgis 3.1  (Stephan Knauss <pgsql@stephans-server.de>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Stephan Knauss
Date:
Subject: Debugging leaking memory in Postgresql 13.2/Postgis 3.1
Next
From: Adrian Klaver
Date:
Subject: Re: Upgrading from 11 to 13