Repository navigation
companion: set JetsamProperties in overlay plist and drain autorelease pools - #158
Merged
henrikklee merged 1 commit intoDec 4, 2026
Conversation
…e pools Set JetsamPriority (160) and JetsamMemoryLimit (256 MB) in the palera1n overlay launchd job (crates/runtime/src/overlay.rs) to match resize-apfs's helper plist and Dopamine daemon plist, preventing iPadOS Jetsam from killing orchard-companion at its default unlisted-daemon limit (~18 MB InactiveHard) during long APFS shrinks. Wrap the long-running background thread and socket-serving loops in companion/Helper/main.swift and ios-installer/Helper/main.swift in autoreleasepool so bridged Foundation objects from 1 Hz status writes, refresh inspections, and keepalive/log RPCs are freed on every iteration instead of accumulating across multi-hour shrinks. Fixes OrchardLinux#156 Assisted-by: LLM
grierj
force-pushed
the
fix/companion-jetsam-and-autoreleasepool
branch
from
December 4, 2026 16:53
a6fcffc to
fc5c3a4
Compare
henrikklee
added a commit
to brkosebay/tools
that referenced
this pull request
Dec 4, 2026
resize-apfs#42 (grierj) frees the helper's autoreleased memory on every shrink step and refresh, and tells a helper restart from a device restart by kern.bootsessionuuid. Together with OrchardLinux#158's Jetsam limit for the companion, a long APFS split no longer has its helper killed partway. Assisted-by: LLM
Merged
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.
Fixes #156 (and addresses the underlying Jetsam kill noted in #45).
Changes
crates/runtime/src/overlay.rs: AddJetsamProperties(JetsamPriority: 160,JetsamMemoryLimit: 256) tojob(), matchingOrchardLinux/resize-apfs's overlay and Dopamine launchd plists soorchard-companionis not capped at iPadOS's default unlisted-daemon limit (~18 MBInactiveHard).companion/Helper/main.swift: Wrap every iteration ofLauncher.run(), the 1 Hz status rewrite loop, the 1 Hzengine.refresh()loop, andserve(fd)per-request handling inautoreleasepool { ... }.ios-installer/Helper/main.swift: Wrap the 1 HzResizer.run()loop andserve(fd)per-request loop inautoreleasepool { ... }as well.overlay::tests::the_helper_job_sets_jetsam_properties.Pairs with OrchardLinux/resize-apfs#42.
Verification
cargo test -p orchard-runtime: 101 passed, 0 failed.