forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit45f7152
committed
Prevent long-term memory leakage in autovacuum launcher.
get_database_list() failed to restore the caller's memory context,instead leaving current context set to TopMemoryContext which ishow CommitTransactionCommand() leaves it. The callers both thinkthey are using short-lived contexts, for the express purpose ofnot having to worry about cleaning up individual allocations.The net effect therefore is that supposedly short-lived allocationscould accumulate indefinitely in the launcher's TopMemoryContext.Although this has been broken for a long time, it seems we didn'thave any obvious memory leak here until v15's rearrangement of thestats logic. I (tgl) am not entirely convinced that there's noother leak at all, though, and we're surely at risk of adding onein future back-patched fixes. So back-patch to all supportedbranches, even though this may be only a latent bug in pre-v15.Reid ThompsonDiscussion:https://postgr.es/m/972a4e12b68b0f96db514777a150ceef7dcd2e0f.camel@crunchydata.com1 parentf204ad3 commit45f7152
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1916 | 1916 | | |
1917 | 1917 | | |
1918 | 1918 | | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
1919 | 1922 | | |
1920 | 1923 | | |
1921 | 1924 | | |
| |||
0 commit comments
Comments
(0)