forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1c1294b
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 parentc3ffa73 commit1c1294b
1 file changed
+3
-0
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1941 | 1941 |
| |
1942 | 1942 |
| |
1943 | 1943 |
| |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
1944 | 1947 |
| |
1945 | 1948 |
| |
1946 | 1949 |
| |
|
0 commit comments
Comments
(0)