- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitcd3064f
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 parentac3afd1 commitcd3064f
1 file changed
+40
-10
lines changedLines changed: 40 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2059 | 2059 |
| |
2060 | 2060 |
| |
2061 | 2061 |
| |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
2062 | 2068 |
| |
2063 | 2069 |
| |
2064 | 2070 |
| |
| |||
2075 | 2081 |
| |
2076 | 2082 |
| |
2077 | 2083 |
| |
2078 |
| - | |
| 2084 | + | |
| 2085 | + | |
2079 | 2086 |
| |
2080 | 2087 |
| |
2081 | 2088 |
| |
| |||
2093 | 2100 |
| |
2094 | 2101 |
| |
2095 | 2102 |
| |
2096 |
| - | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
2097 | 2106 |
| |
2098 | 2107 |
| |
2099 | 2108 |
| |
| |||
2114 | 2123 |
| |
2115 | 2124 |
| |
2116 | 2125 |
| |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
2117 | 2132 |
| |
2118 | 2133 |
| |
2119 | 2134 |
| |
| |||
2485 | 2500 |
| |
2486 | 2501 |
| |
2487 | 2502 |
| |
| 2503 | + | |
| 2504 | + | |
2488 | 2505 |
| |
2489 | 2506 |
| |
2490 | 2507 |
| |
| |||
2666 | 2683 |
| |
2667 | 2684 |
| |
2668 | 2685 |
| |
2669 |
| - | |
2670 |
| - | |
| 2686 | + | |
| 2687 | + | |
2671 | 2688 |
| |
2672 | 2689 |
| |
2673 | 2690 |
| |
| |||
2716 | 2733 |
| |
2717 | 2734 |
| |
2718 | 2735 |
| |
| 2736 | + | |
2719 | 2737 |
| |
2720 | 2738 |
| |
2721 | 2739 |
| |
| |||
2728 | 2746 |
| |
2729 | 2747 |
| |
2730 | 2748 |
| |
2731 |
| - | |
2732 |
| - | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
2733 | 2753 |
| |
2734 | 2754 |
| |
2735 | 2755 |
| |
| |||
2832 | 2852 |
| |
2833 | 2853 |
| |
2834 | 2854 |
| |
| 2855 | + | |
| 2856 | + | |
2835 | 2857 |
| |
2836 | 2858 |
| |
2837 | 2859 |
| |
| |||
2863 | 2885 |
| |
2864 | 2886 |
| |
2865 | 2887 |
| |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
2866 | 2892 |
| |
2867 | 2893 |
| |
2868 | 2894 |
| |
| |||
3088 | 3114 |
| |
3089 | 3115 |
| |
3090 | 3116 |
| |
| 3117 | + | |
3091 | 3118 |
| |
3092 | 3119 |
| |
3093 | 3120 |
| |
3094 | 3121 |
| |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
3095 | 3127 |
| |
| 3128 | + | |
3096 | 3129 |
| |
3097 | 3130 |
| |
3098 | 3131 |
| |
3099 |
| - | |
3100 |
| - | |
3101 |
| - | |
3102 |
| - | |
| 3132 | + | |
3103 | 3133 |
| |
3104 | 3134 |
| |
3105 | 3135 |
| |
|
0 commit comments
Comments
(0)