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

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Remove an "optimization" I installed in 2001, to make repalloc()
Date: 2007-08-12 20:39:14
Message-ID: 20070812203914.1628A754258@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Browse pgsql-committers by date

  From Date Subject
Next Message User Mkz 2007-08-12 21:15:50 pgbouncer - pgbouncer: list.h: remove max_count as it was unused,
Previous Message Tom Lane 2007-08-12 20:18:07 pgsql: Increase the initial size of StringInfo buffers to 1024 bytes