Re: Creating a function for exposing memory usage of backend process

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Creating a function for exposing memory usage of backend process
Дата
Msg-id 1554676.1597886946@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Creating a function for exposing memory usage of backend process  (Andres Freund <andres@anarazel.de>)
Ответы Re: Creating a function for exposing memory usage of backend process  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "osumi.takamichi@fujitsu.com"
Дата:
Сообщение: RE: Implement UNLOGGED clause for COPY FROM
Следующее
От: Peter Smith
Дата:
Сообщение: Re: Libpq support to connect to standby server as priority