forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit81fe138
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 parentcc510d9 commit81fe138
2 files changed
+14
-9
lines changedLines changed: 1 addition & 6 deletions
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 |
| |
|
Lines changed: 13 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3353 | 3353 |
| |
3354 | 3354 |
| |
3355 | 3355 |
| |
3356 |
| - | |
3357 |
| - | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
3358 | 3366 |
| |
3359 | 3367 |
| |
3360 | 3368 |
| |
3361 | 3369 |
| |
| 3370 | + | |
3362 | 3371 |
| |
3363 | 3372 |
| |
3364 | 3373 |
| |
3365 | 3374 |
| |
3366 | 3375 |
| |
3367 |
| - | |
3368 | 3376 |
| |
3369 | 3377 |
| |
3370 | 3378 |
| |
| |||
3422 | 3430 |
| |
3423 | 3431 |
| |
3424 | 3432 |
| |
| 3433 | + | |
| 3434 | + | |
3425 | 3435 |
| |
3426 | 3436 |
| |
3427 | 3437 |
| |
|
0 commit comments
Comments
(0)