Skip to content

Measure the DuckDB memory trim by the memory it releases - #4398

Merged
erikdarlingdata merged 2 commits into
devfrom
test/duckdb-trim-measured-reduction
Sep 26, 2026
Merged

erikdarlingdata merged 2 commits into
devfrom
test/duckdb-trim-measured-reduction

Conversation

@erikdarlingdata

@erikdarlingdata erikdarlingdata commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Test-only.

RunMemoryTrimCycle_AfterWideRead_ReducesProcessMemory asserted that the whole-process WorkingSet64 strictly decreased. In the nightly run it grew by one 4 KB page, so the test failed. Process working set is noisy, and it isn't what the trim acts on.

RunMemoryTrimCycle lowers DuckDB's memory_limit on the sentinel connection and restores it. The product already reads DuckDB's own usage through duckdb_memory(). The test now asserts the trim's own contract on that metric: usage is above the trim target (TrimTargetMemoryLimit, 64 MB) before the trim, and at or below it after. How far below the target DuckDB lands varies by platform. Windows CI measured about 106 MB before and 64 MB after; macOS measured about 98 MB before and 0.75 MB after.

The seed data changes from a repeated literal, which DuckDB compresses to about 0.5 MB, to an md5-chained payload. The wide read then leaves a real buffer to release.

No CHANGELOG entry: test-only.

@erikdarlingdata
erikdarlingdata marked this pull request as ready for review September 26, 2026 07:31
@erikdarlingdata
erikdarlingdata merged commit 3d6a3c5 into dev Sep 26, 2026
17 of 18 checks passed
@erikdarlingdata
erikdarlingdata deleted the test/duckdb-trim-measured-reduction branch September 26, 2026 07:31
erikdarlingdata added a commit that referenced this pull request Sep 26, 2026
…4438)

Adds the missing [Unreleased] CHANGELOG entries for nine merged PRs. Two more need none.

- Fixed: #3588, #3886, #3889, #3900, #3911, #4016, #4032 and #4042.
- Changed: #4157. llms.txt and CITATION.cff now match the shipped product.
- None:
  - #4332 adds RawChunkIntervalPlanner without wiring it in; the later PR that wires it carries its own entry.
  - #4398 changes tests only.
- Each entry was written from its PR's diff, with a [#N] label linking the pull request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant