Re: SlabCheck leaks memory into TopMemoryContext

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: SlabCheck leaks memory into TopMemoryContext
Дата
Msg-id 20200117144004.k3rjrypctn55mqnh@development
обсуждение исходный текст
Ответ на Re: SlabCheck leaks memory into TopMemoryContext  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, Jan 16, 2020 at 01:41:39PM -0500, Tom Lane wrote:
>Andres Freund <andres@anarazel.de> writes:
>> On 2020-01-16 18:01:53 +0100, Tomas Vondra wrote:
>>> and it's only really used in debug builds anyway. So I'm not all that
>>> woried about this wasting a couple extra kB of memory.
>
>> IDK, making memory usage look different makes optimizing it harder. Not
>> a hard rule, obviously, but ...
>
>Well, if you're that excited about it, make a patch so we can see
>how ugly it ends up being.
>

I think the question is how much memory would using globals actually
save, compared to including the bitmap in SlabContext.

The bitmap size depends on block/chunk size - I don't know what
parameters Andres uses for the additional contexts, but for the two
places already using Slab we have 8kB blocks with 80B and 240B chunks,
so ~102 and ~34 chunks in a block. So it's not a huge amount, and we
could easily reduce this to 1/8 by switching to a proper bitmap.


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Complete data erasure
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: Expose lock group leader pid in pg_stat_activity