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

Commit4b98016

Browse files
committed
Report memory context stats upon out-of-memory in repalloc[_huge].
This longstanding functionality evidently got lost in commit3d6d1b5. Noted while studying an OOM report from JaimeCasanova. Backpatch to 9.5 where the bug was introduced.
1 parentab737f6 commit4b98016

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/backend/utils/mmgr/mcxt.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,10 +1051,13 @@ repalloc(void *pointer, Size size)
10511051

10521052
ret= (*context->methods->realloc) (context,pointer,size);
10531053
if (ret==NULL)
1054+
{
1055+
MemoryContextStats(TopMemoryContext);
10541056
ereport(ERROR,
10551057
(errcode(ERRCODE_OUT_OF_MEMORY),
10561058
errmsg("out of memory"),
10571059
errdetail("Failed on request of size %zu.",size)));
1060+
}
10581061

10591062
VALGRIND_MEMPOOL_CHANGE(context,pointer,ret,size);
10601063

@@ -1131,10 +1134,13 @@ repalloc_huge(void *pointer, Size size)
11311134

11321135
ret= (*context->methods->realloc) (context,pointer,size);
11331136
if (ret==NULL)
1137+
{
1138+
MemoryContextStats(TopMemoryContext);
11341139
ereport(ERROR,
11351140
(errcode(ERRCODE_OUT_OF_MEMORY),
11361141
errmsg("out of memory"),
11371142
errdetail("Failed on request of size %zu.",size)));
1143+
}
11381144

11391145
VALGRIND_MEMPOOL_CHANGE(context,pointer,ret,size);
11401146

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp