Re: Make MemoryContextMemAllocated() more precise

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Make MemoryContextMemAllocated() more precise
Дата
Msg-id 2253a0d148c4768016629f056141db94cdb80ca1.camel@j-davis.com
обсуждение исходный текст
Ответ на Make MemoryContextMemAllocated() more precise  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Make MemoryContextMemAllocated() more precise  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
On Mon, 2020-03-16 at 11:45 -0700, Jeff Davis wrote:
> Attached is a patch that makes mem_allocated a method (rather than a
> field) of MemoryContext, and allows each memory context type to track
> the memory its own way. They all do the same thing as before
> (increment/decrement a field), but AllocSet also subtracts out the
> free
> space in the current block. For Slab and Generation, we could do
> something similar, but it's not as much of a problem because there's
> no
> doubling of the allocation size.

Committed.

In an off-list discussion, Andres suggested that MemoryContextStats
could be refactored to achieve this purpose, perhaps with flags to
avoid walking through the blocks and freelists when those are not
needed.

We discussed a few other names, such as "space", "active memory", and
"touched". We didn't settle on any great name, but "touched" seemed to
be the most descriptive.

This refactoring/renaming can be done later; right now I committed this
to unblock disk-based Hash Aggregation, which is ready.

Regards,
    Jeff Davis





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

Предыдущее
От: Chris Bandy
Дата:
Сообщение: Re: [PATCH] Add schema and table names to partition error
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Define variables in the approprieate scope