Re: Separate memory contexts for relcache and catcache

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Melih Mutlu <m(dot)melihmutlu(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Separate memory contexts for relcache and catcache
Date: 2023-08-09 13:22:42
Message-ID: 20230809132242.agn5acrcpe4izn7p@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023-Aug-09, Melih Mutlu wrote:

> --Patch
> name | used_bytes | free_bytes | total_bytes
> -----------------------+------------+------------+-------------
> RelCacheMemoryContext | 4706464 | 3682144 | 8388608
> CatCacheMemoryContext | 3489384 | 770712 | 4260096
> index info | 2102160 | 113776 | 2215936
> CacheMemoryContext | 2336 | 5856 | 8192
> relation rules | 4416 | 3776 | 8192
> (5 rows)

Hmm, is this saying that there's too much fragmentation in the relcache
context? Maybe it would improve things to make it a SlabContext instead
of AllocSet. Or, more precisely, a bunch of SlabContexts, each with the
appropriate chunkSize for the object being stored. (I don't say this
because I know for a fact that Slab is better for these purposes; it's
just that I happened to read its comments yesterday and they stated that
it behaves better in terms of fragmentation. Maybe Andres or Tomas have
an opinion on this.)

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"I love the Postgres community. It's all about doing things _properly_. :-)"
(David Garamond)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2023-08-09 13:23:32 Re: [RFC] Clang plugin for catching suspicious typedef casting
Previous Message Tom Lane 2023-08-09 13:18:14 Re: pg15: reltuples stuck at -1 after pg_upgrade and VACUUM