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

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Remove an "optimization" I installed in 2001, to make repalloc()
Date
Msg-id 20070812203914.1628A754258@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
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)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Increase the initial size of StringInfo buffers to 1024 bytes
Next
From: mkz@pgfoundry.org (User Mkz)
Date:
Subject: pgbouncer - pgbouncer: list.h: remove max_count as it was unused,