forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc28bfb3
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 parentbb5a217 commitc28bfb3
2 files changed
+14
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
879 | 879 | | |
880 | 880 | | |
881 | 881 | | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | 882 | | |
889 | 883 | | |
890 | 884 | | |
891 | 885 | | |
| 886 | + | |
892 | 887 | | |
893 | 888 | | |
894 | 889 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2360 | 2360 | | |
2361 | 2361 | | |
2362 | 2362 | | |
2363 | | - | |
2364 | | - | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
2365 | 2373 | | |
2366 | 2374 | | |
2367 | 2375 | | |
2368 | 2376 | | |
| 2377 | + | |
2369 | 2378 | | |
2370 | 2379 | | |
2371 | 2380 | | |
2372 | 2381 | | |
2373 | 2382 | | |
2374 | | - | |
2375 | 2383 | | |
2376 | 2384 | | |
2377 | 2385 | | |
| |||
2428 | 2436 | | |
2429 | 2437 | | |
2430 | 2438 | | |
| 2439 | + | |
| 2440 | + | |
2431 | 2441 | | |
2432 | 2442 | | |
2433 | 2443 | | |
| |||
0 commit comments
Comments
(0)