Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9d3ebba

Browse files
committed
pgstat: Create memory contexts below TopMemoryContext
So far they were created below CacheMemoryContext. However, that's notguaranteed to exist in all situations, leading to memory contexts created astop-level contexts. There isn't actually a good reason anymore to create thembelow CacheMemoryContext, so just creating them below TopMemoryContext seemsthe best approach.Reported-by: Reid Thompson <reid.thompson@crunchydata.com>Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>Reviewed-by: Andres Freund <andres@anarazel.de>Author: "Drouvot, Bertrand" <bdrouvot@amazon.com>Discussion:https://postgr.es/m/b948b729-42fe-f88c-2f4a-0e65d84c049b@amazon.comBackpatch: 15-
1 parentfdd8937 commit9d3ebba

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎src/backend/utils/activity/pgstat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ pgstat_prep_pending_entry(PgStat_Kind kind, Oid dboid, Oid objoid, bool *created
10691069
if (unlikely(!pgStatPendingContext))
10701070
{
10711071
pgStatPendingContext=
1072-
AllocSetContextCreate(CacheMemoryContext,
1072+
AllocSetContextCreate(TopMemoryContext,
10731073
"PgStat Pending",
10741074
ALLOCSET_SMALL_SIZES);
10751075
}

‎src/backend/utils/activity/pgstat_shmem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,12 +992,12 @@ pgstat_setup_memcxt(void)
992992
{
993993
if (unlikely(!pgStatSharedRefContext))
994994
pgStatSharedRefContext=
995-
AllocSetContextCreate(CacheMemoryContext,
995+
AllocSetContextCreate(TopMemoryContext,
996996
"PgStat Shared Ref",
997997
ALLOCSET_SMALL_SIZES);
998998
if (unlikely(!pgStatEntryRefHashContext))
999999
pgStatEntryRefHashContext=
1000-
AllocSetContextCreate(CacheMemoryContext,
1000+
AllocSetContextCreate(TopMemoryContext,
10011001
"PgStat Shared Ref Hash",
10021002
ALLOCSET_SMALL_SIZES);
10031003
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp