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

Commita7915f1

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 parent1598dc1 commita7915f1

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
@@ -969,10 +969,13 @@ repalloc(void *pointer, Size size)
969969

970970
ret= (*context->methods->realloc) (context,pointer,size);
971971
if (ret==NULL)
972+
{
973+
MemoryContextStats(TopMemoryContext);
972974
ereport(ERROR,
973975
(errcode(ERRCODE_OUT_OF_MEMORY),
974976
errmsg("out of memory"),
975977
errdetail("Failed on request of size %zu.",size)));
978+
}
976979

977980
VALGRIND_MEMPOOL_CHANGE(context,pointer,ret,size);
978981

@@ -1049,10 +1052,13 @@ repalloc_huge(void *pointer, Size size)
10491052

10501053
ret= (*context->methods->realloc) (context,pointer,size);
10511054
if (ret==NULL)
1055+
{
1056+
MemoryContextStats(TopMemoryContext);
10521057
ereport(ERROR,
10531058
(errcode(ERRCODE_OUT_OF_MEMORY),
10541059
errmsg("out of memory"),
10551060
errdetail("Failed on request of size %zu.",size)));
1061+
}
10561062

10571063
VALGRIND_MEMPOOL_CHANGE(context,pointer,ret,size);
10581064

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp