- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit82dd1c2
committed
Fix memory leak in repeated SPGIST index scans.
spgendscan neglected to pfree all the memory allocated by spgbeginscan.It's possible to get away with that in most normal queries, since thememory is allocated in the executor's per-query context which is aboutto get deleted anyway; but it causes severe memory leakage duringcreation or filling of large exclusion-constraint indexes.Also, document that amendscan is supposed to free what ambeginscanallocates. The docs' lack of clarity on that point probably caused thisbug to begin with. (There is discussion of changing that API spec goingforward, but I don't think it'd be appropriate for the back branches.)Per report from Bruno Wolff. It's been like this since the beginning,so back-patch to all active branches.In HEAD, also fix an independent leak caused by commit2a63683(allocating memory during spgrescan instead of spgbeginscan, whichmight be all right if it got cleaned up, but it didn't). And do a bitof code beautification on that commit, too.Discussion:https://postgr.es/m/20181024012314.GA27428@wolff.to1 parent7dd8b3c commit82dd1c2
File tree
2 files changed
+10
-1
lines changed- doc/src/sgml
- src/backend/access/spgist
2 files changed
+10
-1
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
455 | 455 |
| |
456 | 456 |
| |
457 | 457 |
| |
458 |
| - | |
| 458 | + | |
| 459 | + | |
459 | 460 |
| |
460 | 461 |
| |
461 | 462 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
236 | 236 |
| |
237 | 237 |
| |
238 | 238 |
| |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
239 | 247 |
| |
240 | 248 |
| |
241 | 249 |
| |
|
0 commit comments
Comments
(0)