3

Alfred is great, of course, and I use it all the time. However, if I haven't opened it for a little while it can take a few seconds to open the search-bar UI. Otherwise, it will open in less than a quarter of a second.

I believe this is to do with the fact that it is moved out of memory by the operating system, meaning it has to be copied back in next time I request it (note: I have a mechanical hard-drive, not an SSD, so that takes ages).

So my question is this: can I force macOS to leave an application in main memory even if I'm not using it?

  • 1
    If you can’t figure this out, check out LaunchBar - it’s blazing fast for me on very old, HDD macs. It’s not totally equivalent to Alfred, but does fast keyboard launching very, very well IMO. – bmike Apr 19 at 23:27
  • +1 for launchbar... it's really fast and has been for almost 18 years that I've been using it – dwightk Apr 20 at 2:02
  • Thanks, I had a quick look at their site and it looks pretty good, so I'll give it a try. – Zac Apr 20 at 20:01
3

MacOS's memory management is quite sophisticated, and it generally does try to keep as much stuff in memory as possible. If Alfred is still running, then it will be in memory.

If you have quit Alfred, then it might still be retained in memory, which is why it is faster to load next time. However, the OS will clear the quit app from memory, if the memory is needed for something else. So you might experience slowness somewhere else if you don't let the OS clear the quit app.

Recommendations for improving speed:

  1. Leave Alfred running all the time. If it's slow to come to foreground sometimes, even when its been running in the background, then that's not a memory issue, but something else: possibly related the slowness of the HDD.
  2. Get more RAM, if possible. You don't say what model of Mac and how much RAM.
  3. Replace the HDD with an SSD.
  • I have 8GB of RAM, and I tend to be using about 5GB of that most of the time (according to Activity Monitor). I think your first point, about it relating to the slowness of the HDD, is probably right - though unfortunate because SSDs are annoyingly expensive. – Zac Apr 19 at 15:53
  • 1
    @Zac SSDs are pretty cheap these days, particularly SATA ones to replace mechanicals. I can see 128 GB ones for £20, €20, $20. That's big enough for your OS and apps at least, which should make a huge difference. – benwiggy Apr 19 at 16:19
1

If your goal is to simply keep an application running all the time even when you close it you could use the method described here in this articled titled: Always keep an application open .

In that article they describe using this method for the Stickies application.

Steps

Excerpted here in case it ever gets deleted

For example, to keep Stickies permanently open, remove Stickies from the login items for your account (if you've placed it there), quit Stickies, and then create the following plist file in the LaunchAgents folder of your home Library (~/Library/LaunchAgents) with the name user.launchkeep.stickies.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>user.launchkeep.stickies</string>
  <key>KeepAlive</key>
  <true/>
  <key>Program</key>
  <string>/Applications/Stickies.app/Contents/MacOS/Stickies</string>
</dict>
</plist>

Now load this launchd job by logging out of your account and logging back in or launch Terminal and enter:

$ launchctl load ~/Library/LaunchAgents/user.launchkeep.stickies.plist

Stickies will now effectively be un-removable -- any time it quits, crashes, or gets forced-quit it will pop right back up. If fact, in order to quit the app at any time other than logout or shutdown you'll need to disable the job; In Terminal type:

$ launchctl remove user.launchkeep.stickies 

Or you can set up a script that does that for you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .