Re: Creating a function for exposing memory usage of backend process
torikoshia <torikoshia@oss.nttdata.com>
From: torikoshia <torikoshia@oss.nttdata.com>
To: Kasahara Tatsuhito <kasahara.tatsuhito@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, Fujii Masao
<masao.fujii@oss.nttdata.com>, PostgreSQL-development
<pgsql-hackers@postgresql.org>
Date: 2020-07-31T08:24:44Z
Lists: pgsql-hackers
Attachments
- 0007-Adding-a-function-exposing-memory-usage-of-local-backend.patch (text/x-diff) patch 0007
- TEST-make-child-of-dynahash.patch (text/x-diff) patch
On 2020-07-30 15:13, Kasahara Tatsuhito wrote: > Hi, > > On Fri, Jul 10, 2020 at 5:32 PM torikoshia <torikoshia@oss.nttdata.com> > wrote: >> - whether information for identifying parent-child relation is >> necessary >> or it's an overkill > I think it's important to understand the parent-child relationship of > the context. > Personally, I often want to know the following two things .. > > - In which life cycle is the target context? (Remaining as long as the > process is living? per query?) > - Does the target context belong to the correct (parent) context? > >> - if this information is necessary, memory address is suitable or >> other >> means like assigning unique numbers are required > IMO, If each context can be uniquely identified (or easily guessed) by > "name" and "ident", > then I don't think the address information is necessary. > Instead, I like the way that directly shows the context name of the > parent, as in the 0005 patch. Thanks for your opinion! I also feel it'll be sufficient to know not the exact memory context of the parent but the name of the parent context. And as Fujii-san told me in person, exposing memory address seems not preferable considering there are security techniques like address space layout randomization. > On 2020-07-10 08:30:22 +0900, torikoshia wrote: >> On 2020-07-08 22:12, Fujii Masao wrote: >> Another comment about parent column is: dynahash can be parent? >> If yes, its indent instead of name should be displayed in parent >> column? > I'm not sure yet, but considering the changes in the future, it seems > better to do so. Attached a patch which displays ident as parent when dynahash is a parent. I could not find the case when dynahash can be a parent so I tested it using attached test purposed patch. Regards, -- Atsushi Torikoshi NTT DATA CORPORATION
Commits
-
Add regression test for pg_backend_memory_contexts.
- adc8fc6167aa 14.0 landed
-
Move codes for pg_backend_memory_contexts from mmgr/mcxt.c to adt/mcxtfuncs.c.
- 50db5964ee33 14.0 landed
-
Prevent non-superusers from reading pg_backend_memory_contexts, by default.
- 29dd6d8bc631 14.0 landed
-
Add pg_backend_memory_contexts system view.
- 3e98c0bafb28 14.0 landed
-
Fix yet another issue with step generation in partition pruning.
- 199cec977950 14.0 cited