memleak_analyzer
memleak_analyzer · A PostgreSQL extension designed to analyze and localize logical memory leaks inside PostgreSQL backend sessions and background workers.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101459 | memleak_analyzer | memleak_analyzer | 1.0 | STAT | MIT | C |
Usage
Sources:
- Official upstream README
- Official extension control file (memleak_analyzer.control)
- Official extension SQL (memleak_analyzer–1.0.sql)
memleak_analyzer — pg-memleak-analyzer is a diagnostic tool and a PostgreSQL extension designed to analyze and localize logical memory leaks inside PostgreSQL backend sessions and background workers. Use it when collecting or interpreting the corresponding PostgreSQL statistics. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.
Core Workflow
Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.
Important Objects
memleak_analyzer.analyze_bgw(target_pid INTEGER, observation_interval INTEGER)is an extension function and returnsTABLE.memleak_analyzer.analyze_query(query text)is an extension function and returnsTABLE.memleak_analyzer.get_bgw_snapshot(target_pid INTEGER)is an extension function and returnsTABLE.memleak_analyzeris a schema created by the extension.
Requirements and Caveats
- The reviewed control file declares default version
1.0. - The control file marks the extension as relocatable.
- Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.