From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: torikoshia <torikoshia@oss.nttdata.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Kasahara Tatsuhito <kasahara.tatsuhito@gmail.com>
Subject: Re: Creating a function for exposing memory usage of backend process
Date: Wed, 19 Aug 2020 21:29:06 -0400
Message-ID: <1554676.1597886946@sss.pgh.pa.us> (raw)
In-Reply-To: <20200819225343.c7rxteydi35nhrdp@alap3.anarazel.de>
References: <98e53274-253f-6bd1-b542-489ecbda8753@oss.nttdata.com>
<083781e2-339e-9844-a02c-53a0ee3beb82@oss.nttdata.com>
<e687d9ec8ca6e7f387131a2455bc9e1f@oss.nttdata.com>
<34517933-7e90-f644-f606-86d7132b240b@oss.nttdata.com>
<0b339b06646e2c56a3aa081699322346@oss.nttdata.com>
<f1ae4071-31b8-d7aa-db5d-2781e5612e6f@oss.nttdata.com>
<261eebda3e1909475162b968e5a4ad2b@oss.nttdata.com>
<66ae5b88-208d-96fa-c20a-fb539b597859@oss.nttdata.com>
<20200819135545.GC19121@paquier.xyz>
<1414992.1597849297@sss.pgh.pa.us>
<20200819225343.c7rxteydi35nhrdp@alap3.anarazel.de>
Andres Freund <andres@anarazel.de> writes:
> On 2020-08-19 11:01:37 -0400, Tom Lane wrote:
>> I agree with that, but I think this patch has a bigger problem:
>> why bother at all? It seems like a waste of code space and future
>> maintenance effort, because there is no use-case.
> I don't agree with this at all. I think there's plenty use cases. It's
> e.g. very common to try to figure out why the memory usage of a process
> is high. Is it memory not returned to the OS? Is it caches that have
> grown too much etc.
Oh, I agree completely that there are lots of use-cases for finding
out what a process' memory map looks like. But this patch fails to
address any of them in a usable way.
>> My own thoughts about improving the debugging situation would've been
>> to create a way to send a signal to a session to make it dump its
>> current memory map to the postmaster log (not the client, since the
>> client is unlikely to be prepared to receive anything extraneous).
> That doesn't really work in a large number of environments, I'm
> afraid. Many many users don't have access to the server log.
My rationale for that was (a) it can be implemented without a lot
of impact on the memory map, and (b) requiring access to the server
log eliminates questions about whether you have enough privilege to
examine the map. I'm prepared to compromise about (b), but less so
about (a). Having to run a SQL query to find this out is a mess.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, michael@paquier.xyz, masao.fujii@oss.nttdata.com, torikoshia@oss.nttdata.com, robertmhaas@gmail.com, kasahara.tatsuhito@gmail.com
Subject: Re: Creating a function for exposing memory usage of backend process
In-Reply-To: <1554676.1597886946@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