Skip to content

Commit 4d0d607

Browse files
committed
release memory used while flushing logical mappings
Patch by Ants Aasma
1 parent c27bf77 commit 4d0d607

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/access/heap/rewriteheap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ logical_heap_rewrite_flush_mappings(RewriteState state)
897897

898898
/* write all mappings consecutively */
899899
len = src->num_mappings * sizeof(LogicalRewriteMappingData);
900-
waldata = palloc(len);
900+
waldata = MemoryContextAlloc(state->rs_cxt, len);
901901
waldata_start = waldata;
902902

903903
/*
@@ -943,6 +943,7 @@ logical_heap_rewrite_flush_mappings(RewriteState state)
943943
/* write xlog record */
944944
XLogInsert(RM_HEAP2_ID, XLOG_HEAP2_REWRITE, rdata);
945945

946+
pfree(waldata);
946947
}
947948
Assert(state->rs_num_rewrite_mappings == 0);
948949
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy