Skip to content

test(memory): pin that a closed tab lets go of its rows and its result - #4598

Merged
datlechin merged 5 commits into
mainfrom
perf/closed-result-memory
Nov 27, 2026
Merged

datlechin merged 5 commits into
mainfrom
perf/closed-result-memory

Conversation

@datlechin

@datlechin datlechin commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Summary

  • ClosedTabReleaseTests (new) runs a query through the real run path (runQuery on a coordinator with a stub driver returning 2,000 rows), builds the tab's grid model, closes the tab with closeTabsByUser, then checks that nothing holds what the result held: the tab's ResultSet, through a weak reference, and its row buffer, through a copy of ContiguousArray<Row> whose storage must be uniquely held after the close. Two cases: the last tab, and one of two.
  • The stub driver accepts switchDatabase(to:). The run path pins a MySQL tab to its database before it runs, and the PluginKit default throws "This driver does not support database switching", so no row ever arrived. That was the macOS Tests failure on CI.
  • Step 4 of perf(memory): find why footprint stays high after a large result is closed #4557 in code form, the "live reference" branch. The footprint table and the malloc_zone_pressure_relief reading stay on perf(memory): find why footprint stays high after a large result is closed #4557: they need the real app against a live server.

Test plan

  • verify.sh test ClosedTabReleaseTests: PASS, 2 executed, 2 passed.
  • verify.sh build: PASS. verify.sh lint on the test file: PASS.
  • Codex review and security pass: no findings.

Closes #4557

A closed result's footprint stayed high after the close. This pins the half of the
question code can answer: after closeTabsByUser nothing keeps the tab's ResultSet or
its row buffer alive, whether it was the last tab or one of two.
@datlechin
datlechin enabled auto-merge (squash) November 26, 2026 01:52
@datlechin
datlechin merged commit 8c47b6c into main Nov 27, 2026
2 of 3 checks passed
@datlechin
datlechin deleted the perf/closed-result-memory branch November 27, 2026 16:36
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.

perf(memory): find why footprint stays high after a large result is closed

1 participant