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)
commite5243da630c3114e511a8878af0149e5816621bb
tree09563fc896ea1dd30e74b6f524fa99bdb7fa182f
parent408a86b0dc6f1fdd582b64857c2568150afbe4d5
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