My older iMac is complaining that it’s running out of application memory. How do I figure out what app is causing the problem and fix it?
Ah, yes, the dreaded “Your system has run out of application memory” error in MacOS X. It’s not a problem that comes up too often because being built on a Unix foundation, Mac OS X actually has decades of memory management evolution under the hood, but sometimes you can get a program that gets bigger and bigger in memory and causes problems. Surprisingly, though, sometimes the problem has nothing to do with the applications you’re running at all and instead is all about the disk space you have available.
Turns out that for the memory in your computer to work properly and let you gracefully multitask, you need to ensure that there’s space on disk for the operating system to temporarily write out blocks of memory so that the precious commodity of RAM (random access memory, the fast, expensive stuff) can be utilized by the current foreground task or program. Think of it this way: you can’t put calls on hold on a fancy phone system if you don’t have enough space for each incoming call. Memory works the same way, a combination of your RAM (and an older iMac might have 8GB or 16GB of RAM) and your disk space (hopefully your iMac has at least 256GB of disk space to be useful).
Let’s start with the basics, though. Here’s the kind of error message you’re probably seeing:
Never a good thing. Notice also that the system pauses commands that it can’t run because of the lack of memory, in this case the developer’s program Xcode. That’s a pain because even if you get rid of all the other applications, it’s not easy to unpause a paused program in MacOS X.
Pro tip: If you do want to unpause it once you’ve freed up resources, use the Terminal. The ps command can get you the process ID of the paused program, then use kill -CONT processID to send a continue signal to the application and bring it back to life. Make sure you include the -CONT or you’ll instead kill the app instead.
Since you’re in the Force Quit Applications window when you see this error, you can simply pick programs that are gracefully exited (like Preview, perhaps, or Mail) and click “Force Quit” to get rid of ’em.
While it’s possible that there’s a program with a so-called memory leak or other bad coding that causes it to get bigger and bigger, eventually greedily consuming all memory resources, it’s also possible that you can encounter this problem because you’ve run out of disk space!
Check your disk resources by going to “About This Mac” from the Apple menu (top left of your screen) then choosing “Storage”. The most modern versions of MacOS X give you this attractive display:
The most important thing to check is how much space you have that’s available. I have 127.22GB of 499.96GB, which is great. You’ll always want at least 10% disk space available for the OS and memory swapping tasks, but 15% is a better number if you can manage it. With a 500GB drive that means I’d need to keep 50-75GB free if possible. The less available space you have, the more you’re stressing the memory manager and disk manager and can see some performance issues.
There’s also a great program included with MacOS X that you should check to see the memory footprint of each app on your iMac too: Activity Monitor. This can be found in Applications > Utilities and is terrific for getting an idea of what’s happening with your computer in a lot of different ways. On my MacBook Pro, for example, here’s how memory usage stacks up:
I clicked on the “Memory” column title to have processes sorted by memory usage and you can see that kernel_task is using the most, followed by Kiwi for Gmail helper and CrashPlanService. Kiwi is a third party Gmail interface and it’s somewhat known for being inefficient with memory so that’s no surprise to me. Notice it needs just under 1GB of memory to run (and that there are two additional processes with the same name that want another 214MB and 174MB too). On my system, quitting Kiwi and its helper apps will free up a lot of memory needs.
Then again, as you can see in the “memory pressure” box below, I’m in good shape anyway right now, with 16GB of physical memory and only 10GB being used. You can use more memory than you have, of course, because it’ll swap out as needed, but the key value here is “Swap Used” and “Cached Files”: those should always be significantly smaller than your available disk space to keep things humming along.
Check Activity Monitor on your computer and it should help you identify which program is consuming all your memory. Then replace it with a different program that is written to be more memory aware. I should also note that some programs get bigger over many days, so quitting and restarting can ease the problem instantly in those cases (indeed, that’s what “memory leak” refers to: A program that gradually gets bigger because it’s “leaking” memory).
While you’re looking at Activity Monitor, check out the other tabs along the top too. They offer some good insight into CPU usage, which programs are using your network connection aggressively, and so on.
Hope this helps you figure out what’s going on with your iMac!
I am having issues with my 2014 MacBookPro. Two days ago I received a new 2019 15” MacBook Pro. The Apple Care package was purchased too. Well, I should have called them immediately and had them walk me through and gotten it all done right. My husband just took both computers to an Apple store for help. UFDA!!! They should have been cleaned of emails, etc! No disk space left at all. Look forward to receive your newsletter! Thank you!
Thanks! Lots of good ideas. The Activity Monitor showed that iconservicesagent was using 6gb! I’ll continue to research to find out how to fix that. But your article helped me to eliminate some possible causes and narrow in on one.
This happens to me every night with one Facebook game I’ve played long term (Kingdoms of Camelot). I use a script to help automate things and that is where I think my issue is. This doesn’t seem to happen throughout the day when Im on it, only when my screen is off and it’s just sitting there overnight running this script. There doesn’t seem to be any fix so far.
I’ve removed almost all my files with the exception of iphotos and Garageband which each up a lot of space- but MANY times I feel like, “MAN! I SHOULD be able to run a stinken’ Facebook game without eating through all my memory! ”
The problem lies within the fact Im using a 2015 MacbookPro Intel Core i7 and I now live in 2018. The demand on browser memory is totally different than it was in 2015.