

I only have 40GB RAM (and run lots of apps at once) so I see bursts in compressed and swap more frequently than you with 64GB.įor most people the memory pressure is the only thing they need to worry about. At various times I do something which requires more RAM (or maybe I just have so many apps running), the really 'free' memory becomes low and macOS compresses some of the inactive (grey goes to purple) and often also sends some of it into the swap file. Firstly after a reboot, the compressed RAM (purple) and swapfile are zero. My swapfile usage graph has the same characteristic as yours. The algorithm deciding which RAM to keep as inactive, or compressed, or in the swap file is complex (and not published except for what is in the open source parts of the kernel). macOS keeps such memory in RAM because it is (perhaps) likely to be used again in the future. The inactive RAM is a cache of memory belonging to processes on your system, but which have not been used for some long time. This is normal and the more RAM you have the more is likely to be 'inactive'. Even though I have lots of compressed RAM and some swap usage, my free+inactive is nearly 50% like yours. Don't go trying to diagnose issues that do not exist. The big take-away for the past decade or two with regards to memory management (in pretty much every modern platform) is this:Īs above, ignore it until performance becomes a problem, THEN go trying to diagnose the issue (and start with the "memory pressure" reading). Because looking at the individual numbers is a bit more complicated than it may appear. This is why Apple introduced a "memory pressure" graph. But in a form that can be INSTANTLY dropped and re-allocated if needed. So, chances are it may well still be in RAM (in the form of disk cache) anyway. Guess what is very likely in there? That's right - the stuff (or at least much of it) that your PC swapped out. So, see all that swap? Look at your "cached files" (or on your older platform 'cache') number. So it does.Įven better, if idle memory is swapped to disk, it can be used for disk cache. That's work the OS can do in advance, if the processes are IDLE. Otherwise you'd be waiting for 4 GB to be swapped out at that point before the memory could be allocated. Yours is extremely low, as your system is pretty much idling.Ī modern sensible OS will pro-actively put idle stuff in swap so that IF you make a large demand on memory (e.g., you have 4 GB of total 16 GB free, but say 4 GB is IDLE, and suddenly request 8 GB), it does not need to start swapping it out at that point - it can just immediately make the memory available as it was already swapped out whilst idle. If you want to monitor which way your memory is trending, just watch the memory pressure indicator. MacOS will tell you when it's running out of memory and prompt you to close programs. It may never be needed or touched, but it is allocated, and if needed, the system will start swapping to those allocated addresses.Īnyway, instead of deep-diving modern memory management, let it suffice to say that your memory situation if completely normal and utterly not worth worrying about.

But it shows on the resource monitor because that memory is mapped somewhere, usually on disk. Obviously that is over-subscribed since a low-end linux box might only have 2-4 GB of physical memory. Linux's virtual memory (and yes, I know it's not exactly the same as swap) supports up to 64GB of virtual memory *per process*.

Now, I know and love MacOS but I am much more familiar with Linux virtual memory mgmt, and I assume it is somewhat similar on the Mac. Virtual memory, is allocated to every process that runs. People go crazy when the RAM graph 'fills up' and the like. The best thing to with memory is ignore it.
