- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit02502c1
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 parent6aa33af commit02502c1
1 file changed
+40
-10
lines changedLines changed: 40 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2073 | 2073 |
| |
2074 | 2074 |
| |
2075 | 2075 |
| |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
2076 | 2082 |
| |
2077 | 2083 |
| |
2078 | 2084 |
| |
| |||
2089 | 2095 |
| |
2090 | 2096 |
| |
2091 | 2097 |
| |
2092 |
| - | |
| 2098 | + | |
| 2099 | + | |
2093 | 2100 |
| |
2094 | 2101 |
| |
2095 | 2102 |
| |
| |||
2107 | 2114 |
| |
2108 | 2115 |
| |
2109 | 2116 |
| |
2110 |
| - | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
2111 | 2120 |
| |
2112 | 2121 |
| |
2113 | 2122 |
| |
| |||
2128 | 2137 |
| |
2129 | 2138 |
| |
2130 | 2139 |
| |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
2131 | 2146 |
| |
2132 | 2147 |
| |
2133 | 2148 |
| |
| |||
2499 | 2514 |
| |
2500 | 2515 |
| |
2501 | 2516 |
| |
| 2517 | + | |
| 2518 | + | |
2502 | 2519 |
| |
2503 | 2520 |
| |
2504 | 2521 |
| |
| |||
2680 | 2697 |
| |
2681 | 2698 |
| |
2682 | 2699 |
| |
2683 |
| - | |
2684 |
| - | |
| 2700 | + | |
| 2701 | + | |
2685 | 2702 |
| |
2686 | 2703 |
| |
2687 | 2704 |
| |
| |||
2730 | 2747 |
| |
2731 | 2748 |
| |
2732 | 2749 |
| |
| 2750 | + | |
2733 | 2751 |
| |
2734 | 2752 |
| |
2735 | 2753 |
| |
| |||
2742 | 2760 |
| |
2743 | 2761 |
| |
2744 | 2762 |
| |
2745 |
| - | |
2746 |
| - | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
2747 | 2767 |
| |
2748 | 2768 |
| |
2749 | 2769 |
| |
| |||
2852 | 2872 |
| |
2853 | 2873 |
| |
2854 | 2874 |
| |
| 2875 | + | |
| 2876 | + | |
2855 | 2877 |
| |
2856 | 2878 |
| |
2857 | 2879 |
| |
| |||
2883 | 2905 |
| |
2884 | 2906 |
| |
2885 | 2907 |
| |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
2886 | 2912 |
| |
2887 | 2913 |
| |
2888 | 2914 |
| |
| |||
3140 | 3166 |
| |
3141 | 3167 |
| |
3142 | 3168 |
| |
| 3169 | + | |
3143 | 3170 |
| |
3144 | 3171 |
| |
3145 | 3172 |
| |
3146 | 3173 |
| |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
| 3178 | + | |
3147 | 3179 |
| |
| 3180 | + | |
3148 | 3181 |
| |
3149 | 3182 |
| |
3150 | 3183 |
| |
3151 |
| - | |
3152 |
| - | |
3153 |
| - | |
3154 |
| - | |
| 3184 | + | |
3155 | 3185 |
| |
3156 | 3186 |
| |
3157 | 3187 |
| |
|
0 commit comments
Comments
(0)