- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit13d21b4
committed
Fix per-relation memory leakage in autovacuum.
PgStat_StatTabEntry and AutoVacOpts structs were leaked untilthe end of the autovacuum worker's run, which is bad news ifthere are a lot of relations in the database.Note: pfree'ing the PgStat_StatTabEntry structs here seems a bitrisky, because pgstat_fetch_stat_tabentry_ext does not guaranteeanything about whether its result is long-lived. It appears okayso long as autovacuum forces PGSTAT_FETCH_CONSISTENCY_NONE, butI think that API could use a re-think.Also ensure that the VacuumRelation structure passed tovacuum() is in recoverable storage.Back-patch to v15 where we started to manage table statisticsthis way. (The AutoVacOpts leakage is probably older, butI'm not excited enough to worry about just that part.)Author: Tom Lane <tgl@sss.pgh.pa.us>Reviewed-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/285483.1746756246@sss.pgh.pa.usBackpatch-through: 151 parent0e0174b commit13d21b4
1 file changed
+32
-6
lines changedLines changed: 32 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2154 | 2154 |
| |
2155 | 2155 |
| |
2156 | 2156 |
| |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
2157 | 2163 |
| |
2158 | 2164 |
| |
2159 | 2165 |
| |
| |||
2170 | 2176 |
| |
2171 | 2177 |
| |
2172 | 2178 |
| |
2173 |
| - | |
| 2179 | + | |
| 2180 | + | |
2174 | 2181 |
| |
2175 | 2182 |
| |
2176 | 2183 |
| |
| |||
2188 | 2195 |
| |
2189 | 2196 |
| |
2190 | 2197 |
| |
2191 |
| - | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
2192 | 2201 |
| |
2193 | 2202 |
| |
2194 | 2203 |
| |
| |||
2209 | 2218 |
| |
2210 | 2219 |
| |
2211 | 2220 |
| |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
2212 | 2227 |
| |
2213 | 2228 |
| |
2214 | 2229 |
| |
| |||
2572 | 2587 |
| |
2573 | 2588 |
| |
2574 | 2589 |
| |
| 2590 | + | |
| 2591 | + | |
2575 | 2592 |
| |
2576 | 2593 |
| |
2577 | 2594 |
| |
| |||
2749 | 2766 |
| |
2750 | 2767 |
| |
2751 | 2768 |
| |
2752 |
| - | |
2753 |
| - | |
| 2769 | + | |
| 2770 | + | |
2754 | 2771 |
| |
2755 | 2772 |
| |
2756 | 2773 |
| |
| |||
2799 | 2816 |
| |
2800 | 2817 |
| |
2801 | 2818 |
| |
| 2819 | + | |
2802 | 2820 |
| |
2803 | 2821 |
| |
2804 | 2822 |
| |
| |||
2811 | 2829 |
| |
2812 | 2830 |
| |
2813 | 2831 |
| |
2814 |
| - | |
2815 |
| - | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
2816 | 2836 |
| |
2817 | 2837 |
| |
2818 | 2838 |
| |
| |||
2921 | 2941 |
| |
2922 | 2942 |
| |
2923 | 2943 |
| |
| 2944 | + | |
| 2945 | + | |
2924 | 2946 |
| |
2925 | 2947 |
| |
2926 | 2948 |
| |
| |||
2952 | 2974 |
| |
2953 | 2975 |
| |
2954 | 2976 |
| |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
2955 | 2981 |
| |
2956 | 2982 |
| |
2957 | 2983 |
| |
|
0 commit comments
Comments
(0)