fix(macos): prevent automatic termination during memory pressure - #9312
Conversation
I don't really care for little stuff like this that is gonna be a single line in the plist. I have issues when people are submitting patches that are large "AI" generated code they do not understand and also do not fully test. |
2ab2ca6 to
bd2e374
Compare
There was a problem hiding this comment.
@nbolton This looks good to me now can you approve / land when ready. (I made a change so i can't anymore)
@johnweldon Ill keep this updated from here on out.
Disable macOS Automatic Termination to prevent the server/client from being killed during memory pressure events. Adds NSSupportsAutomaticTermination to Info.plist and programmatically disables termination in the Cocoa app. Fixes deskflow#7329 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
bd2e374 to
dbb9b70
Compare
|
@sithlord48 I'm wondering if this change is actually effective. According to the docs, the detail on
Memory-pressure terminations on macOS are actually handled by jetsam/ AFAIK the kernel doesn't change it's behavior based on |
|
FWIW, the issue has not re-occurred for me since this change. |
Good to know, thanks for the info. What's memory use like after the Core process has been running a few days? |
|
@nbolton -- the short answer: it's stable. After ~13d 18h continuous
uptime on Synergy 1.20.0, the Core process is sitting at ~18.7 MB RSS.
Snapshot from Activity Monitor on this host today:
| Process | PID | RSS | Threads | CPU time |
| ----------------------- | ---- | ------- | ------- | -------- |
| `synergy` (GUI) | 3623 | 37.3 MB | 6 | 1:22.85 |
| `synergy-server` (Core) | 3710 | 18.7 MB | 11 | 39:01.89 |
Host: macOS 26.4.1 (build 25E253), Darwin 25.4.0, arm64 (Apple Silicon
/ M2 Air), Synergy 1.20.0 from `/Applications/Synergy.app`.
Across multi-week sessions both before and after this PR I've seen the
Core process stay in roughly that 15-20 MB range. CPU is ~1% on Core
during active use, 0% when idle.
Thank you for all your work on this product... I've used it
continuously for what feels like at least ten or twelve years
|
What about with Deskflow? |
@nbolton -- apologies, I muddled the two. The numbers I posted are from Symless's commercial Synergy 1.20.0 build ( |
I'm the maintainer of the Synergy 1 commercial downstream code. Changes from Deskflow flow down into Synergy over time, so if it's not happening in Synergy but is happening in Deskflow, then this is useful information. Would you be able to try Deskflow? Deskflow and Synergy 1 are protocol compatible so you'd only need to update your Mac. |
Disable macOS Automatic Termination to prevent the server/client from being killed during memory pressure events. Adds NSSupportsAutomaticTermination to Info.plist and programmatically disables termination in the Cocoa app.
Fixes #7329
🤖 Generated with Claude Code (But not AI Trash)
Edit: (sithlord48)