pgsql: Improve memory management code to avoid inefficient behavior when

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Improve memory management code to avoid inefficient behavior when
Дата
Msg-id 20061227223048.E47E29FA2FD@postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Improve memory management code to avoid inefficient behavior when a context
has a small maxBlockSize: the maximum request size that we will treat as a
"chunk" needs to be limited to fit in maxBlockSize.  Otherwise we will round
up the request size to the next power of 2, wasting space, which is a bit
pointless if we aren't going to make the blocks big enough to fit additional
stuff in them.  The example motivating this is local buffer management, which
makes repeated allocations of 8K (one BLCKSZ buffer) in TopMemoryContext,
which has maxBlockSize = 8K because for the most part allocations there are
small.  This leads to each local buffer actually eating 16K of space, which
adds up when there are thousands of them.  I intend to change localbuf.c to
aggregate its requests, which will prevent this particular misbehavior, but
it seems likely that similar scenarios could arise elsewhere, so fixing the
core problem seems wise as well.

Modified Files:
--------------
    pgsql/src/backend/utils/mmgr:
        aset.c (r1.69 -> r1.70)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mmgr/aset.c.diff?r1=1.69&r2=1.70)

В списке pgsql-committers по дате отправления:

Предыдущее
От: okbob@pgfoundry.org (User Okbob)
Дата:
Сообщение: plpsm - plpgpsm: for statement support (compileable)
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Modify local buffer management to request memory for local