Обсуждение: pgsql: Remove an "optimization" I installed in 2001, to make repalloc()

Поиск
Список
Период
Сортировка

pgsql: Remove an "optimization" I installed in 2001, to make repalloc()

От
tgl@postgresql.org (Tom Lane)
Дата:
Log Message:
-----------
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.

Modified Files:
--------------
    pgsql/src/backend/utils/mmgr:
        aset.c (r1.73 -> r1.74)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mmgr/aset.c?r1=1.73&r2=1.74)