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