Cap DuckDB compaction memory at 2 GB (#758)#762
Merged
erikdarlingdata merged 1 commit intodevfrom Mar 30, 2026
Merged
Conversation
The in-memory DuckDB connection used for archive compaction was using the default memory_limit (80% of physical RAM), causing multi-GB spikes when decompressing large parquet archives. With 800 MB of compressed archives, this easily hits 5-7 GB. Set memory_limit=2GB so DuckDB spills to disk instead of consuming all available RAM. Also set preserve_insertion_order=false to reduce memory pressure since compaction has no meaningful row order. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
memory_limit = '2GB'on the in-memory DuckDB connection used for parquet archive compactionpreserve_insertion_order = falseto further reduce memory during COPY operationsRoot cause: the default
memory_limitis 80% of physical RAM. Decompressing 800 MB of parquet archives (user reported 230 MB query_store_stats alone) easily expands to 5-7 GB in memory.Companion to #760 which fixed the long-running event handler and delta cache leaks.
Test plan
🤖 Generated with Claude Code