Link to home
Start Free TrialLog in
Avatar of Robert
RobertFlag for United States of America

asked on

iMac low memory

A client just purchased a new iMac a few weeks ago.  After completing the setup and migration all of their files, we noticed a "low memory" warning appear every time the iMac was rebooted

User generated image
At first, I thought this was adware/PUP, but eventually believed this to be a legit Mac OS popup.  I used Activity Monitor to monitor resources, but the only processes consuming memory (not CPU), was WindowsServer.  I checked but did not see any out-of-place apps that could be causing issues.

I ran a malwarebytes scan on the system, but it came back clean
I also checked the Startup folder for the primary account, but it was empty

After closing/acknowledging the warning message, it does not appear again until after the next reboot.  While this is a cosmetic warning message, there does not appear to be any sort of performance impact on the system.  Nevertheless, it would be nice to kill this popup.
Avatar of David Favor
David Favor
Flag of United States of America image

Unlikely this is any Malware problem, so malwarebytes (or similar) will provide no benefit.

Tip: My iMac is fairly quiet, only running processes - Mail Client, Browser, Skype, many ssh sessions - which normally eat up 17G+.

So if I had <32G memory, this machine would be swapping.

If I run ffmpeg doing an HEVC transcode, using massively long lookahead buffers, all 32G of memory gets eaten up instantly.

Guideline: These days, 32G memory as a minimum to ensure no swapping, as once swapping starts, machine death can be quick.

A low memory message normally appears, just prior to machine death.

Run Activity Monitor looking at your memory usage.

16G - machine will be slow + likely survive.

8G - machine will run low on memory all the time + life will be a constant struggle.

If this is a new Mac with <32G, person might be able to return it for a 32G machine.
@David - Not sure how you determine that a 16G machine will be slow or why your machine would start swapping if it had <32G - can you elaborate?

I'm using a 16G MacBook Pro that uses just over 8G of memory in use where I have opened FireFox, Brave, Mail, terminal, Safari, Spotify and Activity Monitor. Machine is running fine, quite fast, no high resource usage at all.

@Robert - If you run Activity Monitor and look at the Memory tab (sort on the Memory column), what are the top 3 memory using processes?

User generated image
Question: do you have any (non Apple) security or maintenance utilities installed?
Avatar of Robert

ASKER

@Gerwin - From the Activity Monitor, the two highest offending processes are WindowsServer and the Apple webkit.  After that, all of the remaining processes are using a marginal amount of memory.

Again, the iMac (with 8GB RAM) does not exhibit any performance issues.  It is lightening fast, the problem is that this message appears after a restart, and I'm trying to figure out how to suppress it.  Both the webkit and the WindowsServer are core processes that are required for the OS to run, so I'm not sure how to throttle their memory consumption.

@David - while I don't believe swapping will largely impact the system with the NVMe drive installed, I am curious how I can monitor disk swapping on the Mac.  I could monitor disk activity, but that would not be focused to just swap.  Does Mac have a vmstat equivalent program that I could use?
To monitor swapping, use /Applications -> Utilities -> Terminal -> top.

1) Look for 3rd line, which will look like this...

MemRegions: 75610 total, 5822M resident, 0B private, 2267M shared. PhysMem: 21G used (2300M wired), 11G unused.

Open in new window


Look for PhysMem used + unused.

2) Then look at 4th line...

VM: 1356G vsize, 0B framework vsize, 384(0) swapins, 1419(0) swapouts. Networks: packets: 216119003/237G in, 92507425/12G out.

Open in new window


If you're swapping the swapins + swapouts will be != 0.
@Robert - You could check these folders for items that
run at startup/login:

/Library/LaunchAgents
/System/Library/LaunchAgents
~/Library/LaunchAgents

It may just be a PUP that displays that message at startup of login.  Use spotlight to show contents of these folders.
Since this is a iMac with only 8GB, I suspect it's an M1 version.  Intel versions would need a minimum of 16 GB just to be usable.  Swap is something OS X designs into its core.  RAM  is something they don't seem to

The Popup probably shows up because it hasn't loaded the system swap yet.  Virtual memory is controlled by software (the OS) and the software hasn't fully loaded when you saw that popup.  You probably also have other software that loads up at startup when the initialization happens.  I don't think you can get rid of it unless you uninstall some Launch Agents as @Gerwin Jansen suggested, or you are able to change the order of system software loads, so that Virtual memory functions load up before the more memory intensive portions load up.

 Maybe look into updating OS X if it hasn't been updated to the latest version.  If this is really new, I suggest wiping it and returning the system to swap for the 16 GB M1 to avoid that message.  The 8GB version is going to swap to disk a whole lot.

Apple OS X, unlike Windows and Linux really needs to have swap.  They tend to sell system with barely just enough RAM for the non-technical users so they can have a Mac.  Knowledgeable users will know to buy them with more RAM and not the minimum.  The minimum RAM offering is only good for the current OS version.  Eventual upgrades in OS will make your system non-functional.  You'd either have to buy more RAM, if possible, or just remain on the current OS, which many users do.
The message you see is a fake message and it's a virus in action.
There is probably an application in your login items that is launched every time you start your Mac.
You should delete this virus with malware bytes or combo cleaner
Or you can also delete it manually (Active processes, login items, application itself, browser plug-ins and cashes)

Don't believe the comments that you need 16 or 32 GB of RAM, 8 GB is absolutely fine for almost everyone.
You will only need more ram for specific situations like virtual machines or complex photo/video editing software.
@Robert, you mentioned, "while I don't believe swapping will largely impact the system with the NVMe drive installed, I am curious how I can monitor disk swapping on the Mac.  I could monitor disk activity, but that would not be focused to just swap.  Does Mac have a vmstat equivalent program that I could use?"

Any time memory must swap out to disk (including NVMe), then swap back into memory.

There will be a slow down, as there's additional I/O.

To answer your question, attach the output of the following command...

top -o CPU -l 1

Open in new window

Been reading a bit, there are more 8GB users that have this issue. Something to try: can you exit Safari completely and then reboot your machine? I've seen a few reports where Safari is using excessive memory and when you are opening Safari automatically when you restart this could explain the issue.
ASKER CERTIFIED SOLUTION
Avatar of Robert
Robert
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I’m not amused at all when things get solved by themselves 😉

But thanks for the feedback and glad it’s working!