model-writtenrun 8203 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Atsushi Torikoshi proposed SQL access to backend memory-context usage to diagnose memory bloat without a debugger, outlining eventual cross-process communication but limiting the first implementation to the current backend #1.
- Fujii Masao, Robert Haas and Tatsuhito Kasahara explored all-process monitoring and targeted snapshots, identifying shared-memory sizing, update overhead and response timing as obstacles to the broader design #2 #3 #4.
- Torikoshi submitted a local-backend function based on Fujii's pg_cheat_funcs implementation, including identifiers to distinguish cached queries; Fujii's review led to a view and column documentation #7 #8 #10.
- Fujii argued that the interface represented current system state rather than statistics, leading to relocation into mmgr/mcxt.c and catalogs.sgml, followed by backend-specific naming and documentation cleanup; Daniel Gustafsson also requested leaving catalog-version bumps to the committer #11 #12 #16 #18 #20.
- The implementation retained dynahash naming consistent with MemoryContextStatsPrint() and a 1024-byte identifier display limit, while ambiguous parent names prompted Andres Freund to suggest exposing addresses #15 #19 #22.
- Torikoshi implemented address and parent-address columns experimentally, but Kasahara preferred recognizable parent names, and concerns about defeating ASLR led Torikoshi to restore parent names and levels while fixing dynahash parent identifiers #24 #26 #27.
- Robert Haas and Michael Paquier explained the security risks of exposed pointers, reinforcing the decision to omit addresses; the extra dynahash-child patch was used only for diagnostic testing #28 #30 #27.
- Kasahara reported successful testing, and Fujii's subsequent review improved documentation ordering, context assertions and recursive parent-name handling before the final submission #29 #32 #33 #34 #35 #36.
- Fujii committed the view from #36 as 3e98c0bafb, adding NULL-name handling and a catalog-version bump, and announced the landing in #37.
- Regression testing was initially omitted because memory usage varies, but Michael Paquier argued for a minimal stable test and requested moving the SQL functions out of the low-level memory-context implementation #38 #39 #40.
- Tom Lane requested a revert over limited usefulness, observation overhead and possible security exposure; Andres Freund, Fujii and Kasahara defended its value for persistent memory bloat, and the discussion instead pursued access restrictions and future cross-backend inspection #41 #42 #43 #44 #45 #47.
- Torikoshi submitted three follow-up patches for testing, code relocation and pg_monitor-based restrictions; Michael reviewed them and recommended revoking PUBLIC access so administrators could grant permissions explicitly #48 #49.
- The revised permission patch landed as 29dd6d8bc6 from #50, with only an added catalog-version bump, making both the view and function unavailable to non-superusers by default.
- After discussing file placement and copyright, Fujii accepted the relocation component of #48 and committed it as 50db5964ee, moving the SQL interface to utils/adt/mcxtfuncs.c #52 #53 #55.
- Fujii requested a stronger stable test of TopMemoryContext and its level, which Torikoshi supplied in #54 and which landed unchanged as adc8fc6167 #51.
- The thread ended with Fujii confirming all three follow-up patches were committed; the view remained in place, including used_bytes, while inspection of another backend's memory was left for a separate thread #49 #50 #51 #57.