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

2022-08-01 Thread Kyotaro Horiguchi
At Fri, 29 Jul 2022 21:16:51 +0200, Tomas Vondra 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

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

2022-07-29 Thread Tomas Vondra
On 7/29/22 20:23, Nathan Bossart wrote: > On Fri, Jul 29, 2022 at 01:55:10PM -0400, Tom Lane wrote: >> Nathan Bossart writes: >>> On Fri, Jul 29, 2022 at 12:43:45PM -0400, Reid Thompson wrote: slab.c does not in SlabContextCreate(). Is this intentional, it seems to be an

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

2022-07-29 Thread Nathan Bossart
On Fri, Jul 29, 2022 at 01:55:10PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> On Fri, Jul 29, 2022 at 12:43:45PM -0400, Reid Thompson wrote: >>> slab.c >>> does not in SlabContextCreate(). Is this intentional, it seems to be an >>> oversight to me. > >> IIUC this is because the header is

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

2022-07-29 Thread Tom Lane
Nathan Bossart writes: > On Fri, Jul 29, 2022 at 12:43:45PM -0400, Reid Thompson wrote: >> slab.c >> does not in SlabContextCreate(). Is this intentional, it seems to be an >> oversight to me. > IIUC this is because the header is tracked separately from the first > regular block, unlike aset.c.

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

2022-07-29 Thread Nathan Bossart
On Fri, Jul 29, 2022 at 12:43:45PM -0400, Reid Thompson wrote: > slab.c > does not in SlabContextCreate(). Is this intentional, it seems to be an > oversight to me. > > /* Finally, do the type-independent part of context creation */ > MemoryContextCreate((MemoryContext) slab,

Oversight in slab.c SlabContextCreate(), initial memory allocation size is not populated to context->mem_allocated

2022-07-29 Thread Reid Thompson
Hi, Both aset.c and generation.c populate mem_allocated in AllocSetContextCreateInternal(), GenerationContextCreate() respectively. aset.c /* Finally, do the type-independent part of context creation */