summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/mmgr/mcxt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c
index 34f4e7202f2..01773ffb01b 100644
--- a/src/backend/utils/mmgr/mcxt.c
+++ b/src/backend/utils/mmgr/mcxt.c
@@ -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);