aboutsummaryrefslogtreecommitdiff
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 2bfd364336b..6b7894213c1 100644
--- a/src/backend/utils/mmgr/mcxt.c
+++ b/src/backend/utils/mmgr/mcxt.c
@@ -1051,10 +1051,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);
@@ -1131,10 +1134,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);