forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdc12e47
committed
Fix memory leak in LogStandbySnapshot().
The array allocated by GetRunningTransactionLocks() needs to be pfree'dwhen we're done with it. Otherwise we leak some memory during eachcheckpoint, if wal_level = hot_standby. This manifests as memory bloatin the checkpointer process, or in bgwriter in versions before we madethe checkpointer separate.Reported and fixed by Naoya Anzai. Back-patch to 9.0 where the issuewas introduced.In passing, improve comments for GetRunningTransactionLocks(), and addan Assert that we didn't overrun the palloc'd array.1 parent89bd9fe commitdc12e47
2 files changed
+14
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
875 | 875 | | |
876 | 876 | | |
877 | 877 | | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | 878 | | |
885 | 879 | | |
886 | 880 | | |
887 | 881 | | |
| 882 | + | |
888 | 883 | | |
889 | 884 | | |
890 | 885 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2444 | 2444 | | |
2445 | 2445 | | |
2446 | 2446 | | |
2447 | | - | |
2448 | | - | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
2449 | 2457 | | |
2450 | 2458 | | |
2451 | 2459 | | |
2452 | 2460 | | |
| 2461 | + | |
2453 | 2462 | | |
2454 | 2463 | | |
2455 | 2464 | | |
2456 | 2465 | | |
2457 | 2466 | | |
2458 | | - | |
2459 | 2467 | | |
2460 | 2468 | | |
2461 | 2469 | | |
| |||
2512 | 2520 | | |
2513 | 2521 | | |
2514 | 2522 | | |
| 2523 | + | |
| 2524 | + | |
2515 | 2525 | | |
2516 | 2526 | | |
2517 | 2527 | | |
| |||
0 commit comments
Comments
(0)