Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chris4565

macrumors 65816
Original poster
Sep 22, 2018
1,060
499
Hey everyone,

So there's a bit of an annoying Safari behavior that I have noticed. Here's what's going on:

Whenever I close Safari by clicking on the red "X" (and there's no more Safari window open), Safari automatically quits after a while (approx. after 20 minutes or so). I notice this because the point below the Safari dock icon disappears then.

I have this behavior on both of my MacBook Pros (one running macOS 14.4.1 and one running macOS 13.6.6). Is it supposed to work this way? Is there any way to change this behavior? Thanks in advance!
 

coffeemilktea

macrumors 65816
Nov 25, 2022
1,393
6,158
I think apps that have no windows open are supposed to eventually quit on macOS as a way to save memory... it's been that way for a few years, if I remember right. 🤔
 

bogdanw

macrumors 603
Mar 10, 2009
6,117
3,028
It's not normal behavior. macOS is not iOS. So far :)
“Keep in mind that if you click the Close button in the top-left corner of an app’s window, the window closes, but the app remains open (a small dot below the app’s icon in the Dock indicates that the app’s open).”
https://support.apple.com/guide/mac-help/mchl834d18c2/mac

Expected behavior: “Your computer is low on memory” https://forums.macrumors.com/threads/your-computer-is-low-on-memory.2299061/

But I noticed too that TextEdit sometimes quits when no document is open, regardless of RAM usage.
 

chris4565

macrumors 65816
Original poster
Sep 22, 2018
1,060
499
I think apps that have no windows open are supposed to eventually quit on macOS as a way to save memory... it's been that way for a few years, if I remember right. 🤔
If free memory gets low, macOS will quit closed windows. Sounds like normal behavior to me.
Thanks, however, I don't think this is normal because it only happens with Safari and no other app. On top of that, I'm a quite light user, so I don't have many memory hungry apps running at the same time.
It's not normal behavior. macOS is not iOS. So far :)
[...]
But I noticed too that TextEdit sometimes quits when no document is open, regardless of RAM usage.
Yeah, it's really weird... I have 16 GB of RAM and I only have a handful of apps running at the same time (in background), so it can't be a RAM issue. It also only happens with Safari. Even when I quit Safari and do basically nothing, it quits by itself after a while.
 

zevrix

macrumors 6502
Oct 10, 2012
406
230
Whenever I close Safari by clicking on the red "X" (and there's no more Safari window open), Safari automatically quits after a while (approx. after 20 minutes or so).

I think that's the default behavior for years now. It's called "app sleep".

I don't even know if it's the default these days because 'app sleep' is one of the things I always disable when I install a new system anyway.

You can disable it by running this in Terminal:

Code:
defaults write NSGlobalDomain NSAppSleepDisabled -bool YES
 

svenmany

macrumors demi-god
Jun 19, 2011
2,275
1,520
I think that's the default behavior for years now. It's called "app sleep".

I don't even know if it's the default these days because 'app sleep' is one of the things I always disable when I install a new system anyway.

You can disable it by running this in Terminal:

Code:
defaults write NSGlobalDomain NSAppSleepDisabled -bool YES

I think that doesn't cause the application to quit; it just suspends it so that it doesn't consume resources. Do you have a link to somewhere that says otherwise?
 

zevrix

macrumors 6502
Oct 10, 2012
406
230
I think that doesn't cause the application to quit; it just suspends it so that it doesn't consume resources. Do you have a link to somewhere that says otherwise?

All I know is that back when 'app sleep' was introduced years ago it was truly annoying when apps started quit automatically after some time of inactivity (I think it happened when no windows are open). Especially Xcode.

I guess Apple didn't realize that apps don't open momentarily on Mac (unlike mobile devices). Plus, once again, it was years ago when everything was rather slower (I think I didn't even have SSD back then).

I suspect that many users don't even realize it happens because they don't enable the 'running app' dot in the Dock.

All I know is that enabling NSAppSleepDisabled stopped this behavior.

Like I mentioned I don't know how it's supposed to behave these days as I always disable app sleep right away anyway.
 
Last edited:

svenmany

macrumors demi-god
Jun 19, 2011
2,275
1,520
All I know is that back when 'app sleep' was introduced years ago it was truly annoying when apps started quit automatically after some time of inactivity (I think it happened when no windows are open). Especially Xcode.

I guess Apple didn't realize that apps don't open momentarily on Mac (unlike mobile devices). Plus, once again, it was years ago when everything was rather slower (I think I didn't even have SSD back then).

I suspect that many users don't even realize it happens because they don't enable the 'running app' dot in the Dock.

All I know is that enabling NSAppSleepDisabled stopped this behavior.

Like I mentioned I don't know how it's supposed to behave these days as I always disable app sleep right away anyway.

I reviewed my running system. I had Safari open with no windows. 4 of 11 Safari processes were napping. Perhaps that's why my Safari doesn't quit; some subprocesses keep it running.

I did notice that I have a total of 32 processes napping across many applications. I don't know what energy impact it would have if I were to disable that feature. I'm lucky that I don't have to worry about it.
 

zevrix

macrumors 6502
Oct 10, 2012
406
230
P.S. This also reminded me that there once was a checkbox to disable App Nap for individual apps. I looked for it and it's gone now (don't know since what version of macOS). So I guess there were changes to this behavior. I vaguely recall that I disabled app nap via this checkbox first until I found the command to disable it system-wide.

1712960980751.jpeg
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.