1

Newbie to macOS and I was wondering if it's normal to have swap usage when the system has more than 6 times of available RAM than being used. I have 64GB of RAM installed and the most memory I've seen being used is in the high teens.

I've always associated swapping to a poorly performing system and to my knowledge, it occurs when you're running out of usable RAM.

However, my system does not seem to be performing poorly and if it wasn't for this app, I would have never even noticed this was happening.

To be completely transparent, I'm more concern for the lifespan of my integrated SSD with having swap writing gigabytes to it unnecessarily, daily.

I've noticed this happening twice already and the swapping is cleared after a reboot. Any tips of how to troubleshoot and get to the culprit, if this is not normal in macOS?

enter image description here

enter image description here

2
  • Just wondering: What app is that display from?
    – Barmar
    Jan 31 at 23:37
  • @Barmar That's iStat Menus, a utility which gives you a huge range of info in RHS of the menu bar. It's hugely configurable, and really handy for diagnosing this sort of thing. (It's not free, but I've no connection other than as a happy user.)
    – gidds
    Feb 1 at 7:49

2 Answers 2

2

What you are seeing is normal and a little swapping is not an issue. So don't worry about your SSD.

The value you are reading for "free" memory is a bit deceptive. So, first, let's sort that out.

iStat Menus (by default) hides "Inactive Memory" as "Free". So that some of the 56 GB showing as "free" has been used and is ready to be reused if an app requires it.

In the Memory settings of iStat Menus, clear the tick box next to "Hide inactive memory". enter image description here

Now iStat Menus will distinguish between "Inactive Memory" and the truely "Free" memory.

enter image description here

Regarding memory management, the algorithm may swap inactive memory whenever the true free memory is low.

Memory will remain in the swap file until it is required again or the owning process releases it (e.g. when quitting).

Getting to the important part of your question, you are worried about wear on your SSD.

Do not be concerned about a few GB of swap. Time to worry is when total writes to the SSD get close to 1 TB per day.

You can to track SSD usage. For this I suggest the DriveDx which reads many counters from the drive - including TB written.

enter image description here

This is for my always on 5 year old iMac. It has written 105 TB and DriveDX estimates that it has used 9% of its life time. So I don't worry about a bit of swap usage.

3

MacOS has very sophisticated memory management, and unless you are experiencing performance problems, it doesn't need human oversight. Some swap is entirely normal.

It is not true that "swapping occurs when you're running out of RAM"; nor that it only occurs on "poorly performing" systems.

RAM usage is not as linear as "water filling a bottle". There is the abstraction of virtual memory; there is memory compression; there is caching and there is paging. All of these are used together to service memory needs of processes.

Also, the TBW on SSDs is now such that you can realistically forget about counting down the precious writes to the death of the device. You'll likely want to replace the Mac because you need better performance, or OS support, or USB 15, rather than because the SSD has worn out.

"if it wasn't for this app, I would have never even noticed this was happening."
Then delete the app!

5
  • 1
    Also want to point out that 0.074 GB of SWAP is extremely small. My computer right now is reading 2.02 GB of swap.
    – Ezekiel
    Jan 31 at 15:39
  • 1
    What matters isn't what's got swapped out to disk, but how often it needs to be swapped back in from disk.  If e.g. some app has a chunk of code that's only run once when it starts up, then the OS may feel that it's doing no good holding that in memory that could be better used to cache files from disk.
    – gidds
    Jan 31 at 22:21
  • @gidds From the SSD lifetime point of view, it is the swap outs which matter.
    – Gilby
    Jan 31 at 23:25
  • @Gilby These days, SSD lifetimes are sufficiently long that that's really not a concern.
    – gidds
    Feb 1 at 7:50
  • @gidds SSD lifetime was what was concerning the OP and that is an issue if swap OUTs are large. Not swap INs. See my answer.
    – Gilby
    Feb 1 at 9:31

You must log in to answer this question.

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