Commit 4d0d607a authored by Bruce Momjian's avatar Bruce Momjian

release memory used while flushing logical mappings

Patch by Ants Aasma
parent c27bf777
...@@ -897,7 +897,7 @@ logical_heap_rewrite_flush_mappings(RewriteState state) ...@@ -897,7 +897,7 @@ logical_heap_rewrite_flush_mappings(RewriteState state)
/* write all mappings consecutively */ /* write all mappings consecutively */
len = src->num_mappings * sizeof(LogicalRewriteMappingData); len = src->num_mappings * sizeof(LogicalRewriteMappingData);
waldata = palloc(len); waldata = MemoryContextAlloc(state->rs_cxt, len);
waldata_start = waldata; waldata_start = waldata;
/* /*
...@@ -943,6 +943,7 @@ logical_heap_rewrite_flush_mappings(RewriteState state) ...@@ -943,6 +943,7 @@ logical_heap_rewrite_flush_mappings(RewriteState state)
/* write xlog record */ /* write xlog record */
XLogInsert(RM_HEAP2_ID, XLOG_HEAP2_REWRITE, rdata); XLogInsert(RM_HEAP2_ID, XLOG_HEAP2_REWRITE, rdata);
pfree(waldata);
} }
Assert(state->rs_num_rewrite_mappings == 0); Assert(state->rs_num_rewrite_mappings == 0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment