29 ms·
There are two seemingly opposite behaviors in Lion: 1. Application without a process: if an application has one or more open documents but no documents visible
by thought_alarm 15y ago
There are two seemingly opposite behaviors in Lion:
1. Application without a process: if an application has one or more open documents but no documents visible on screen, the app may terminate itself when resources are low. The applications still appears to be alive in the dock and command+tab menu, but its process has been terminated and is no longer consuming resources. When you command+tab back to the application it restarts itself and restores its previous state.
2. Process without an application: if an application has no open documents it will appear to quit automatically and is removed from the Dock and command+tab menu. In actuality, it remains running in the background ready to spring into action again.
The question is, why support behavior #2 at all?
Behavior #1 covers the automatic resource management and I think it works well (and unlike iOS, Mac applications can opt-out of this behavior). Behavior #2 seems to be aimed at Windows users who have no concept of "Quit", but it only aggravates long-time Mac users with zero actual benefit with respect to resource management. It has nothing to do with iOS and everything to do with grandma Windows users who just bought their first MacBook.
- sudont 15y ago#2: Any headless process that's scanning, or performing a behind-the-scenes operation. And note, it's window not application. Because an application could reliably stay open without a window… until now. Mail. File Transfers. Staying available for chat. Rendering process that can run headless. (Handbrake, I think, plus others.)
- thought_alarm 15y agoApplications that appear to quit are essentially suspended; they consume RAM but not CPU and cannot do work in the background. If an application needs to do work in the background then it is not subject to automatic termination by either behavior #1 or behavior #2 and simply remains running.
- sudont 15y agoYou’re very correct on everything. However, what about anything that is largely async? Background daemons?
- 18pfsmt 15y agoThis is interesting to me because I've become obsessed with the idea of running a 10W, ARM-based system headless, that serves webpages (i.e. HTTP) with the requested data via my LAN. You can leave something like that on all the time, and have instant-on for your higher power devices with displays and such.
- scrod 15y agoRemember that an application has to support the sudden termination API, and indicate to the OS that it can be safely shutdown, in order to actually have this condition apply. http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSProcessInfo_Class/Reference/Reference.html#//apple_ref/doc/uid/20000316-SW3 http://developer.apple.com/library/mac/#documentation/Cocoa/... If you make no changes to your application, then the OS won't touch it. And if you do decide to support sudden termination, then hopefully you would call disableSuddenTermination before starting any background file transfers, renderings, etc.
- thegreatcurve 15y agoBehaviour #2 has resource management benefits too. App-less processes will be terminated when available memory gets low.
- thought_alarm 15y agoResource management is already covered by #1. #2 is strictly a UI convention.
- ridiculous_fish 15y agoBehavior 2 allows apps to appear to relaunch more quickly (since they were never exited).