From 7cdf157a3c74b095832d38985c1048bc07677ff3 Mon Sep 17 00:00:00 2001
From: Melih Mutlu <m.melihmutlu@gmail.com>
Date: Thu, 31 Oct 2024 16:34:34 +0300
Subject: [PATCH v5 2/2] Adjusting cache memory context sizes

---
 src/backend/utils/cache/catcache.c | 6 ++++--
 src/backend/utils/cache/relcache.c | 4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index 7c6a755e35..c2b435b651 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -716,7 +716,7 @@ CreateCacheMemoryContext(void)
 	if (!CacheMemoryContext)
 		CacheMemoryContext = AllocSetContextCreate(TopMemoryContext,
 												   "CacheMemoryContext",
-												   ALLOCSET_DEFAULT_SIZES);
+												   ALLOCSET_START_SMALL_SIZES);
 }
 
 static void
@@ -728,7 +728,9 @@ CreateCatCacheContext(void)
 	if (!CatCacheContext)
 		CatCacheContext = AllocSetContextCreate(CacheMemoryContext,
 													  "CatCacheContext",
-													   ALLOCSET_DEFAULT_SIZES);
+													   ALLOCSET_DEFAULT_MINSIZE,
+													   128 * 1024,
+													   ALLOCSET_DEFAULT_MAXSIZE);
 }
 
 /*
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 82e25b5ac3..b0be345224 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -1623,7 +1623,9 @@ CreateRelCacheContext(void)
 	if (!RelCacheContext)
 		RelCacheContext = AllocSetContextCreate(CacheMemoryContext,
 													  "RelCacheContext",
-													   ALLOCSET_DEFAULT_SIZES);
+													   ALLOCSET_DEFAULT_MINSIZE,
+													   128 * 1024,
+													   ALLOCSET_DEFAULT_MAXSIZE);
 }
 
 /*
-- 
2.34.1

