- Notifications
You must be signed in to change notification settings - Fork28
Commitdbc6eb1
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 parent79e15c7 commitdbc6eb1
2 files changed
+14
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
865 | 865 | | |
866 | 866 | | |
867 | 867 | | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
873 | | - | |
874 | 868 | | |
875 | 869 | | |
876 | 870 | | |
877 | 871 | | |
| 872 | + | |
878 | 873 | | |
879 | 874 | | |
880 | 875 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3398 | 3398 | | |
3399 | 3399 | | |
3400 | 3400 | | |
3401 | | - | |
3402 | | - | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
| 3409 | + | |
| 3410 | + | |
3403 | 3411 | | |
3404 | 3412 | | |
3405 | 3413 | | |
3406 | 3414 | | |
| 3415 | + | |
3407 | 3416 | | |
3408 | 3417 | | |
3409 | 3418 | | |
3410 | 3419 | | |
3411 | 3420 | | |
3412 | | - | |
3413 | 3421 | | |
3414 | 3422 | | |
3415 | 3423 | | |
| |||
3467 | 3475 | | |
3468 | 3476 | | |
3469 | 3477 | | |
| 3478 | + | |
| 3479 | + | |
3470 | 3480 | | |
3471 | 3481 | | |
3472 | 3482 | | |
| |||
0 commit comments
Comments
(0)