yugabyte-db
yugabyte-db copied to clipboard
[YSQL] Import pg_backend_memory_contexts view in YB
Jira Link: DB-3150
Description
For analyzing the memory context, we upstream this diff from postgres 14:
Add pg_backend_memory_contexts system view (from postgres upstream commit 3e98c0bafb28de87ae095b341687dc082371af54)
This view displays the usages of all the memory contexts of the server
process attached to the current session. This information is useful to
investigate the cause of backend-local memory bloat.
This information can be also collected by calling
MemoryContextStats(TopMemoryContext) via a debugger. But this technique
cannot be uesd in some environments because no debugger is available there.
And it outputs lots of text messages and it's not easy to analyze them.
So, pg_backend_memory_contexts view allows us to access to backend-local
memory contexts information more easily.
Author: Atsushi Torikoshi, Fujii Masao
Reviewed-by: Tatsuhito Kasahara, Andres Freund, Daniel Gustafsson, Robert Haas, Michael Paquier
Discussion: https://postgr.es/m/[email protected]