Skip to content

fix(linux): release each helper command's Process after it exits - #64

Merged
melonamin merged 1 commit into
melonamin:linux-portfrom
AlexDobrushskiy:fix/linux-process-leak
Nov 25, 2026
Merged

melonamin merged 1 commit into
melonamin:linux-portfrom
AlexDobrushskiy:fix/linux-process-leak

Conversation

@AlexDobrushskiy

Copy link
Copy Markdown
  • Wait for each helper Process to exit, releasing Foundation’s retained run-loop source.
  • Skip reading empty output files, avoiding swift-foundation’s 4 KiB empty-file leak.
  • Add an AT-SPI memory scenario covering 400 rounds of tree, session text, and surface cursor polling; require heap growth under 1 MiB.
  • Input reports 14,020 KiB growth unfixed, 3,256 KiB with the Process fix alone, and 0 KiB with both fixes.

Claude-Session: https://claude.ai/code/session_017SbYQpnQYu5ebYYcUvPRSG

- Wait for each helper `Process` to exit, releasing Foundation’s retained run-loop source.
- Skip reading empty output files, avoiding swift-foundation’s 4 KiB empty-file leak.
- Add an AT-SPI memory scenario covering 400 rounds of tree, session text, and surface cursor polling; require heap growth under 1 MiB.
- Input reports 14,020 KiB growth unfixed, 3,256 KiB with the `Process` fix alone, and 0 KiB with both fixes.

Claude-Session: https://claude.ai/code/session_017SbYQpnQYu5ebYYcUvPRSG
@melonamin

Copy link
Copy Markdown
Owner

Thanks for tracking down both leaks and adding the Live-mode regression scenario. Tested this with #63 integrated on Swift 6.3.2: all 637 Linux package tests passed, and the real GTK/zmx memory scenario completed 400 tree/text/cursor polling rounds with 0 KiB heap growth. Waiting for the remaining CI checks before merging.

@melonamin

Copy link
Copy Markdown
Owner

Full validation is green: 6,895 core tests, 637 Linux package tests, all 78 GTK scenarios, Debug and Release builds, and the required bundled-zmx/fish server lifecycle gate. The new memory scenario reported 0 KiB growth over 400 polling rounds both locally and in CI. Tested locally with #63 integrated; merging that tested integration now.

@melonamin
melonamin merged commit 984861c into melonamin:linux-port Nov 25, 2026
11 of 12 checks passed
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.

2 participants