Commit 335f3d0
committed
Improve memory management in autovacuum.c.
Invoke vacuum(), as well as "work item" processing, in the PortalContext
that do_autovacuum() has manufactured, which will be reset before each
such invocation. This ensures cleanup of any memory leaked by these
operations. It also avoids the rather dangerous practice of calling
vacuum() in a context that vacuum() itself will destroy while it runs.
There's no known live bug there, but it's not hard to imagine introducing
one if we leave it like this.
Tom Lane, reviewed by Michael Paquier and Alvaro Herrera
Discussion: https://postgr.es/m/13849.1506114543@sss.pgh.pa.us1 parent ad51c6f commit 335f3d0
1 file changed
+17
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2444 | 2444 | | |
2445 | 2445 | | |
2446 | 2446 | | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
2447 | 2450 | | |
2448 | | - | |
2449 | 2451 | | |
2450 | 2452 | | |
2451 | 2453 | | |
| |||
2482 | 2484 | | |
2483 | 2485 | | |
2484 | 2486 | | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
2485 | 2490 | | |
2486 | 2491 | | |
2487 | 2492 | | |
| |||
2533 | 2538 | | |
2534 | 2539 | | |
2535 | 2540 | | |
2536 | | - | |
2537 | | - | |
| 2541 | + | |
2538 | 2542 | | |
2539 | 2543 | | |
2540 | 2544 | | |
| |||
2605 | 2609 | | |
2606 | 2610 | | |
2607 | 2611 | | |
| 2612 | + | |
2608 | 2613 | | |
2609 | 2614 | | |
2610 | 2615 | | |
| |||
2614 | 2619 | | |
2615 | 2620 | | |
2616 | 2621 | | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
2617 | 2625 | | |
2618 | 2626 | | |
2619 | 2627 | | |
| |||
2622 | 2630 | | |
2623 | 2631 | | |
2624 | 2632 | | |
2625 | | - | |
2626 | | - | |
| 2633 | + | |
| 2634 | + | |
2627 | 2635 | | |
| 2636 | + | |
2628 | 2637 | | |
2629 | 2638 | | |
2630 | 2639 | | |
| |||
2668 | 2677 | | |
2669 | 2678 | | |
2670 | 2679 | | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
2671 | 2683 | | |
2672 | 2684 | | |
2673 | 2685 | | |
| |||
0 commit comments