Reduce memory consumption in aggregator#109224
Conversation
|
Workflow [PR], commit [e4b7f58] Summary: ❌
AI ReviewSummaryThis PR tries to reduce memory usage while spilling aggregated data to temporary files by moving the converted columns out of Findings
Tests
Final VerdictStatus: Minimum required actions:
|
|
IIUC, we are now going to move the columns to the block so that they are not held onto until the very end by the source chunk. |
| block.setColumns(agg_chunk.chunk.getColumns()); | ||
| block.info.bucket_num = agg_chunk.bucket_num; | ||
| block.info.is_overflows = agg_chunk.is_overflows; | ||
| block.setColumns(agg_chunk.chunk.detachColumns()); |
There was a problem hiding this comment.
detachColumns() only moves ownership from agg_chunk.chunk into the local block; it does not shorten the lifetime of the spilled aggregate columns themselves. Block::setColumns still copies those ColumnPtrs into block, NativeWriter::write is synchronous, and block stays alive through update_max_sizes(block) below, so the ColumnAggregateFunction objects and their arenas are released at the same point as before. As written, this does not actually deliver the PR's promised memory reduction on the spill path. Please either drop block immediately after the write (or compute the stats before the write and clear it afterward) and attach a before/after measurement, or explain what other lifetime change is supposed to lower peak memory here.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 13/13 (100.00%) · Uncovered code |
882ae8e
Backport #109224 to 26.6: Reduce memory consumption in aggregator
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Reduce memory consumption in aggregator
Version info
26.7.1.473(included in26.7and later)26.6.2.27