Re: Oversight in slab.c SlabContextCreate(), initial memory allocation size is not populated to context->mem_allocated - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Re: Oversight in slab.c SlabContextCreate(), initial memory allocation size is not populated to context->mem_allocated
Date
Msg-id 20220801.165744.517561753479500363.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: Oversight in slab.c SlabContextCreate(), initial memory allocation size is not populated to context->mem_allocated  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
List pgsql-hackers
At Fri, 29 Jul 2022 21:16:51 +0200, Tomas Vondra <tomas.vondra@enterprisedb.com> wrote in 
> I don't think this can make meaningful difference - as you mention, we
> only really use this to decide when to spill to disk etc. So maybe
> you'll spill a bit sooner, but the work_mem is pretty crude threshold
> anyway, people don't tune it to an exact byte value (which would be
> pretty futile anyway).

From another perspective..  SlabStats includes the header size into
its total size. So it reports a different total size from
MemoryContextMemAllocated() (For example, 594 bytes vs 0).  Since this
is an inconsistency within slab.c, no users will notice that
difference in the field.

> OTOH it does seem like an oversight, or at least an inconsistency with
> the two other contexts, so if anyone feels like tweaking it ...

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Dong Wook Lee
Date:
Subject: Re: Add test of pg_prewarm extenion
Next
From: Peter Smith
Date:
Subject: Re: Handle infinite recursion in logical replication setup