1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-19 17:02:53 +03:00

Revert function to get memory context stats for processes

Due to concerns raised about the approach, and memory leaks found
in sensitive contexts the functionality is reverted. This reverts
commits 45e7e8ca9, f8c115a6c, d2a1ed172, 55ef7abf8 and 042a66291
for v18 with an intent to revisit this patch for v19.

Discussion: https://postgr.es/m/594293.1747708165@sss.pgh.pa.us
This commit is contained in:
Daniel Gustafsson
2025-05-23 15:44:54 +02:00
parent 70a13c528b
commit fb844b9f06
29 changed files with 47 additions and 1400 deletions

View File

@@ -232,22 +232,3 @@ select * from pg_timezone_abbrevs where abbrev = 'LMT';
LMT | @ 7 hours 52 mins 58 secs ago | f
(1 row)
DO $$
DECLARE
bg_writer_pid int;
r RECORD;
BEGIN
SELECT pid from pg_stat_activity where backend_type='background writer'
INTO bg_writer_pid;
select type, name, ident
from pg_get_process_memory_contexts(bg_writer_pid, false, 20)
where path = '{1}' into r;
RAISE NOTICE '%', r;
select type, name, ident
from pg_get_process_memory_contexts(pg_backend_pid(), false, 20)
where path = '{1}' into r;
RAISE NOTICE '%', r;
END $$;
NOTICE: (AllocSet,TopMemoryContext,)
NOTICE: (AllocSet,TopMemoryContext,)

View File

@@ -101,21 +101,3 @@ select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
-- One specific case we can check without much fear of breakage
-- is the historical local-mean-time value used for America/Los_Angeles.
select * from pg_timezone_abbrevs where abbrev = 'LMT';
DO $$
DECLARE
bg_writer_pid int;
r RECORD;
BEGIN
SELECT pid from pg_stat_activity where backend_type='background writer'
INTO bg_writer_pid;
select type, name, ident
from pg_get_process_memory_contexts(bg_writer_pid, false, 20)
where path = '{1}' into r;
RAISE NOTICE '%', r;
select type, name, ident
from pg_get_process_memory_contexts(pg_backend_pid(), false, 20)
where path = '{1}' into r;
RAISE NOTICE '%', r;
END $$;