mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-04 19:17:18 +02:00
Report memory context stats upon out-of-memory in repalloc[_huge].
This longstanding functionality evidently got lost in commit
3d6d1b5855
. Noted while studying an OOM report from Jaime
Casanova. Backpatch to 9.5 where the bug was introduced.
This commit is contained in:
parent
1598dc15ba
commit
a7915f114a
@ -969,10 +969,13 @@ repalloc(void *pointer, Size size)
|
||||
|
||||
ret = (*context->methods->realloc) (context, pointer, size);
|
||||
if (ret == NULL)
|
||||
{
|
||||
MemoryContextStats(TopMemoryContext);
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OUT_OF_MEMORY),
|
||||
errmsg("out of memory"),
|
||||
errdetail("Failed on request of size %zu.", size)));
|
||||
}
|
||||
|
||||
VALGRIND_MEMPOOL_CHANGE(context, pointer, ret, size);
|
||||
|
||||
@ -1049,10 +1052,13 @@ repalloc_huge(void *pointer, Size size)
|
||||
|
||||
ret = (*context->methods->realloc) (context, pointer, size);
|
||||
if (ret == NULL)
|
||||
{
|
||||
MemoryContextStats(TopMemoryContext);
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OUT_OF_MEMORY),
|
||||
errmsg("out of memory"),
|
||||
errdetail("Failed on request of size %zu.", size)));
|
||||
}
|
||||
|
||||
VALGRIND_MEMPOOL_CHANGE(context, pointer, ret, size);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user