]> granicus.if.org Git - postgresql/commit
Remove an "optimization" I installed in 2001, to make repalloc() attempt to
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 12 Aug 2007 20:39:14 +0000 (20:39 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 12 Aug 2007 20:39:14 +0000 (20:39 +0000)
commitb70d4a62ee412d09c39428f6112d54d6290fa3d5
tree3d4e0acbd18a531d1f6ec3bf82a412146a79d922
parent70868c012f091169b21f841de99aee71b74570ef
Remove an "optimization" I installed in 2001, to make repalloc() attempt to
enlarge the memory chunk in-place when it was feasible to do so.  This turns
out to not work well at all for scenarios involving repeated cycles of
palloc/repalloc/pfree: the eventually freed chunks go into the wrong freelist
for the next initial palloc request, and so we consume memory indefinitely.
While that could be defended against, the number of cases where the
optimization can still be applied drops significantly, and adjusting the
initial sizes of StringInfo buffers makes it drop to almost nothing.
Seems better to just remove the extra complexity.
Per recent discussion and testing.
src/backend/utils/mmgr/aset.c