• Tom Lane's avatar
    Remove an "optimization" I installed in 2001, to make repalloc() attempt to · b70d4a62
    Tom Lane authored
    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.
    b70d4a62
aset.c 32.6 KB