pgstat-memory.diff

text/x-diff

Filename: pgstat-memory.diff
Type: text/x-diff
Part: 0
Message: pgstat vs aset

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/utils/activity/pgstat.c 9 0
src/backend/utils/activity/pgstat_shmem.c 10 0
diff --git i/src/backend/utils/activity/pgstat.c w/src/backend/utils/activity/pgstat.c
index eb8ccbaa628..fbfa0e8fc3c 100644
--- i/src/backend/utils/activity/pgstat.c
+++ w/src/backend/utils/activity/pgstat.c
@@ -1300,10 +1300,19 @@ pgstat_prep_pending_entry(PgStat_Kind kind, Oid dboid, uint64 objid, bool *creat
 
 	if (unlikely(!pgStatPendingContext))
 	{
+#if 0
 		pgStatPendingContext =
 			AllocSetContextCreate(TopMemoryContext,
 								  "PgStat Pending",
 								  ALLOCSET_SMALL_SIZES);
+#else
+		pgStatPendingContext =
+			GenerationContextCreate(TopMemoryContext,
+									"PgStat Pending",
+									1024,
+									1024,
+									128 * 1024);
+#endif
 	}
 
 	entry_ref = pgstat_get_entry_ref(kind, dboid, objid,
diff --git i/src/backend/utils/activity/pgstat_shmem.c w/src/backend/utils/activity/pgstat_shmem.c
index b8f354c818a..df279665d62 100644
--- i/src/backend/utils/activity/pgstat_shmem.c
+++ w/src/backend/utils/activity/pgstat_shmem.c
@@ -1179,10 +1179,20 @@ static void
 pgstat_setup_memcxt(void)
 {
 	if (unlikely(!pgStatSharedRefContext))
+	{
+#if 0
 		pgStatSharedRefContext =
 			AllocSetContextCreate(TopMemoryContext,
 								  "PgStat Shared Ref",
 								  ALLOCSET_SMALL_SIZES);
+#else
+		pgStatSharedRefContext =
+			SlabContextCreate(TopMemoryContext,
+							  "PgStat Shared Ref",
+							  16*1024,
+							  sizeof(PgStat_EntryRef));
+#endif
+	}
 	if (unlikely(!pgStatEntryRefHashContext))
 		pgStatEntryRefHashContext =
 			AllocSetContextCreate(TopMemoryContext,