macOS is using up all RAM and is constantly telling me I've run out of RAM

Kyakou

macrumors newbie
Original poster
Aug 28, 2017
12
0
Canada
Hey there.

So I've got a 5K iMac from 2017 with 8 gigs of ram and I recently just updated to the newest version of Mojave. After updating, however, I have next to no ram free at around ~1.5 gigs. Before the update, it used to be fast and snappy but now it takes a long ass time for anything to load and it's constantly telling me to force quit applications because I've run out of application memory.

After installing Memory Clean 5, it tells me that ~1.6 gigs in wired, ~2.6 gigs in compressed, ~1.3 in file cache and in total around 6 to 6.5 gigs used constantly. I don't want to delete anything that I shouldn't do so any ideas would be greatly appreciated!

Thank you!
 

DeltaMac

macrumors G3
Jul 30, 2003
9,763
2,426
Delaware
You can check in your Activity Monitor, looking at both the CPU and Memory tabs. Sort by CPU or Memory usage, respectively. You may be able to see what process is using most of your memory.

You should try an NVRAM reset, which sometimes will take care of some system memory issues, particularly after a macOS system upgrade.

and... It's easy to upgrade your RAM on a 5K iMac. Door in the back, add new sticks to empty slots, or replace/upgrade all sticks -- maximum can be 64GB, should you choose to do that.

Do you have a fusion drive?
 
  • Like
Reactions: Weaselboy

Kyakou

macrumors newbie
Original poster
Aug 28, 2017
12
0
Canada
I checked Activity Monitor and most processes seem to be using reasonable amounts of RAM. There is nothing that seems to be using an overwhelming amount of ram and an NVRAM reset hasn't done anything as far as I've noticed.

I'm using a 2 TB fusion drive.

UPDATE: Checked CPU usage in Activity Monitor and it seems like kernel_task is using 99-100% CPU.
 

DeltaMac

macrumors G3
Jul 30, 2003
9,763
2,426
Delaware
How much space is free on your drive?

Try NVRAM reset again.
Follow the steps that I normally use:
Shut down. Unplug the power cord, and anything else that might have power present - printer, network cable, etc.
Wait about 15 seconds, then plug the power cord back in. Don't press the power button yet. Plug in keyboard and mouse, if wired USB, nothing else.
Press and release the power button, immediately press and hold Option-Command-P-R.
You don't have a boot chime, so just hold the 4 keys until you see the video reset a third time (you should see the Apple icon appear briefly, then black screen). That should take, at the most about 30 seconds.
Release the 4 keys then, so your iMac will boot normally. The startup disk will be reset, so go to System preferences, unlock the padlock so you can make changes, and select your boot drive.
Go back to the main preferences screen, open the Spotlight pane/Privacy tab, and add your boot drive to the Quit System preferences, then restart once more.
Click the (+) and add your boot drive to that window. Close that pane, then re-open the same Spotlight pane. Remove your drive from the privacy pane now.
This resets the spotlight database, and can help with your kind of issue (Some of this is not really needed, but just a standard procedure that I always use :cool: )
Search for something. The spotlight search window will show you that a spotlight rebuild is in progress, with a progress bar. If you don't see that, it is complete. This rebuild task might take 15 minutes to an hour, and doesn't affect anything else that you might be doing.
Restart once more.
And - - check your Activity Monitor for improvement.

Have you considered adding more RAM?
 
  • Like
Reactions: Kyakou

Kyakou

macrumors newbie
Original poster
Aug 28, 2017
12
0
Canada
It actually seems worse after doing that. I can't access the Startup Disk settings in Preferences because it just hangs and I'm still facing the same problems.

Adding RAM is currently out of my budget and I don't really see a reason to as my iMac functioned like 100x better before I updated a few days ago. 8 gigs of ram was enough to make it snappy and doing things like loading up chrome would take a matter of seconds. After the damn update though I literally can't do **** on here lol
 

LuisN

macrumors 6502
Mar 30, 2013
286
275
Torres Vedras, Portugal
It actually seems worse after doing that. I can't access the Startup Disk settings in Preferences because it just hangs and I'm still facing the same problems.

Adding RAM is currently out of my budget and I don't really see a reason to as my iMac functioned like 100x better before I updated a few days ago. 8 gigs of ram was enough to make it snappy and doing things like loading up chrome would take a matter of seconds. After the damn update though I literally can't do **** on here lol
Try ONYX https://www.titanium-software.fr/en/index.html
 

DeltaMac

macrumors G3
Jul 30, 2003
9,763
2,426
Delaware
If you just did those steps now, the spotlight database rebuild has not finished yet, and you could see a temporary performance hit while that continues. Let your system sit powered on for a bit, and see how it works in an hour or so.

If you have done those steps (all of them), and no improvement at all - Boot to your current macOS bootable installer.
Reinstall macOS.
 

coolfactor

macrumors 601
Jul 29, 2002
4,473
4,306
Vancouver, BC
If you just did those steps now, the spotlight database rebuild has not finished yet, and you could see a temporary performance hit while that continues. Let your system sit powered on for a bit, and see how it works in an hour or so.

If you have done those steps (all of them), and no improvement at all - Boot to your current macOS bootable installer.
Reinstall macOS.
Yes, it's possible that the Spotlight index is being rebuilt, and that will take a lot of resources. Just be patient.

I frequently experience problems with Calendar sync, which is super frustrating. Apple is supposed to be offering industry-quality, but consumer-friendly apps. Calendar on Mojave is nearly unusable! It's sooooo slow, and when it is doing a sync, it consumes a ton of resources. Very frustrating.
[doublepost=1568493052][/doublepost]
How much space is free on your drive?

Have you considered adding more RAM?
Mojave happily runs with 4GB of memory, so 8GB+ should be more than enough.
 

Ruggy

macrumors 6502
Jan 11, 2017
341
187
Yes, it's possible that the Spotlight index is being rebuilt, and that will take a lot of resources. Just be patient.

I frequently experience problems with Calendar sync, which is super frustrating. Apple is supposed to be offering industry-quality, but consumer-friendly apps. Calendar on Mojave is nearly unusable! It's sooooo slow, and when it is doing a sync, it consumes a ton of resources. Very frustrating.
[doublepost=1568493052][/doublepost]

Mojave happily runs with 4GB of memory, so 8GB+ should be more than enough.
Just to chip in with the same: it can take a day or so for spotlight to re-index everything and that will cause it to be slow for a while.
That has probably caused you to start playing with it- looking for problems running cleaners, etc, and that has restarted everything each time keeping the problem going.
It would probably be best to leave it alone for a while and see if it sorts itself out. Let it finish and see if it settles down before you do anything else.
 

Fishrrman

macrumors P6
Feb 20, 2009
18,039
5,983
Go to the users & groups preference pane.
Click the lock at the bottom left and enter your password.
Now click the "+" sign to create a NEW user account.
Give it administrative privileges and any name and password you want.

Now... POWER DOWN the Mac, all the way off.
Press the power on button, get to the login screen.
Log into the NEW account.
Now, don't "add anything", just look around, try apps, etc.

How do things look now?
 

dsemf

macrumors 6502
Jul 26, 2014
352
76
Eh(?)
Says "Memory Pressure" right there in your screenshot. Big letters, too... o_O
Are you asking what memory pressure means? Mostly, you're looking for low pressure, and green (not yellow, and really not red), and you're good-to-go...
Sorry, I was not clear. I was referring to the previous postings in the thread. Lots of discussions that appear to be CPU related such as spotlight updates, but very little about memory usage, which is the title of the thread. I provided a screen shot as an example.

DS
 
  • Like
Reactions: DeltaMac

jerwin

macrumors 68030
Jun 13, 2015
2,503
4,469
Try restarting into "safe mode"-- immediately press shift after powering it on.

Apple describes it like so.

Safe mode (sometimes called safe boot) is a way to start up your Mac so that it performs certain checks and prevents some software from automatically loading or opening. Starting your Mac in safe mode does the following:

  • Verifies your startup disk and attempts to repair directory issues, if needed
  • Loads only required kernel extensions
  • Prevents startup items and login items from opening automatically
  • Disables user-installed fonts
  • Deletes font caches, kernel cache, and other system cache files
https://support.apple.com/en-us/HT201262

That last step seems to have solved a persistent issue I was having with terminal complaining about not having enough disk space-- on a drive with 80 GB free!

image.png

It also seems to have partially mitigated, but not completely solved an issue related to WindowServer consuming a good deal of memory--multiple gigabytes. I have no idea whether your mac was exhibiting those peculiar symptoms, but perhaps it will help.


Normally, the mere fact that you have 1.98 GB allocated to your disk cache would suggest that you have plenty of memory-- in a properly running macos system, the cache expands when there is free memory avaialble to speed up File I/O , but diminishes as soon as memory is allocated to applications.
 

ApfelKuchen

macrumors 68040
Aug 28, 2012
3,300
1,959
Between the coasts
Having "0" available RAM is not necessarily a bad thing under macOS, and this has been true well before Mojave. The OS operates on the philosophy that there's no need to clear space in RAM until that space is needed for other purposes. The idea is to keep previously-used data and code RAM-resident on the chance it'll be needed again. If it's not needed before something else requires the space, then it's flushed at that time.

That's the point behind the Memory Pressure graph in Activity Monitor - it interprets the behavior of the OS; so long as RAM demands can be met (whether with currently-empty RAM or with stuff that can be flushed to make room), then all is green.

One statistic to watch is Swap Used. While there will probably be some swap used (my 16 GB RAM-equipped iMac currently shows 92 MB swap used), as long as the amount is a small fraction of total RAM things should be fine.
 

jasoncarle

macrumors regular
Jan 13, 2006
170
104
Minnesota
I strongly recommend you find a way to afford the $100 bucks to upgrade to 16GB of RAM. My Mojave mini has 16GB and iStat menu reports I am at 45% RAM usage, which is nearly 8GB.
 

ApfelKuchen

macrumors 68040
Aug 28, 2012
3,300
1,959
Between the coasts
I strongly recommend you find a way to afford the $100 bucks to upgrade to 16GB of RAM. My Mojave mini has 16GB and iStat menu reports I am at 45% RAM usage, which is nearly 8GB.
So you paid for 8 GB of RAM that you aren't using. 45% of 16 GB would have been 90% utilization of 8 GB. Last I looked, that's still under 100% (see what I said earlier about the way macOS manages RAM). Unlike an engine (or CPU), which runs cooler at lower revs, there's no meaningful difference in heat load or wear when running RAM at 90% vs. 45%.

People buy more than they need all the time, whether it's more RAM, or a larger home with extra bedrooms. If it's affordable to them, "just in case I ever need it" may seem wise. However, whether on a small scale or large, there's the question of whether the money could have been spent better elsewhere, saved towards retirement, whatever. Those who have the resources to buy in excess ought to consider whether the person they're advising can similarly afford to spend on excess.
 

jasoncarle

macrumors regular
Jan 13, 2006
170
104
Minnesota
Well, that may be your understanding, but I strongly disagree. But hey, you do you.

Right now I am at 54%, which means if I only had 8GB I would be using swap. That may be fine for me on an SSD but with a fusion drive it would be slow...
 

ApfelKuchen

macrumors 68040
Aug 28, 2012
3,300
1,959
Between the coasts
Well, that may be your understanding, but I strongly disagree. But hey, you do you.

Right now I am at 54%, which means if I only had 8GB I would be using swap. That may be fine for me on an SSD but with a fusion drive it would be slow...
Again, it doesn't necessarily mean you'd be using swap. There's probably stuff that could have been flushed, if necessary, but wasn't because you have 16 GB. But you believe what you wish.
 

DeltaMac

macrumors G3
Jul 30, 2003
9,763
2,426
Delaware
...
Right now I am at 54%, which means if I only had 8GB I would be using swap. That may be fine for me on an SSD but with a fusion drive it would be slow...
No, you don't quite understand how memory works in macOS.
If you are using 54% of your 16GB, and then you change out RAM so you have only 8GB, swap is not a sure result, as the system will correspondingly use less memory, and swap MIGHT become an issue, but that's not necessarily the case.
The macOS system is actually pretty good at how it used whatever memory is available. That may or may not result in extensive swapping in this case. The system can't use nearly 9GB, if it does not exist. But it will use some lower amount, going to swap if needed. You might even find that swap is still rarely used. And even so, with SSD storage, the system may swap, with little noticeable performance hit (much less than with a spinning hard drive!)
And, this part of the discussion doesn't do much for the OP, who has more of a software issue. IMHO, throwing more RAM at that may not help as much as you might hope, until the software issues are resolved.
 
  • Like
Reactions: ApfelKuchen

eRondeau

macrumors 65816
Mar 3, 2004
1,026
111
Canada's South Coast
You don't need more RAM. Instead run your Console (in Utilities) and watch it for a few minutes. I'm guessing you'll see a steady stream of Errors or Faults. Some subsystem is probably calling a file that isn't there -- about a thousand times a second. If you're not used to reading Console Logs, it's perfectly normal to see hundreds of lines per minute fly by. However if you're consistently seeing THE SAME LINES filling the screen that indicates a problem. I agree with the recommendation to create a new user account and go from there.