Re: Debugging leaking memory in Postgresql 13.2/Postgis 3.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Knauss <pgsql(at)stephans-server(dot)de>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Debugging leaking memory in Postgresql 13.2/Postgis 3.1
Date: 2021-03-30 18:46:21
Message-ID: 2919657.1617129981@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stephan Knauss <pgsql(at)stephans-server(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2021-03-30 19:31:27 Re: Upgrading from 11 to 13
Previous Message Stephan Knauss 2021-03-30 18:33:27 Debugging leaking memory in Postgresql 13.2/Postgis 3.1