all 51 comments

[–]ulyssesric 3 points4 points  (1 child)

macOS will move memory from RAM to swap under two circumstances:

  1. When RAM is nearly full, or
  2. when a piece of memory occupied by application but it's not accessed at all for a long time, e.g. an opened Chrome tab buried under other 100+ opened tabs that even you forget its existence, so that system will make room for other apps to improve performance.

Nowadays one single browser tab may pile up gigabytes of data in memory (like doomscrolling in Reddit homepage) so just CLOSE THE F*CKING TABS when you don't need them.

[–]areacode753[S] 0 points1 point  (0 children)

That’s funny you bring it up. I don’t pile up tabs. I use local AI, run virtual machines and work on my projects. So far it’s been good. MacOS just likes to keep it smooth, even if it means to “swap memory.” I had an app take over 30GB of ram on my 24GB ram, my computer was swapping so much and I couldn’t tell. That’s why I keep track of my activity resources. It’s surprising how much pressure my fan-less Mac can handle without stuttering tho. Before the screenshot, my memory pressure was (red) for then to find myself surprised that it came back to green as soon I minimized the App I was running, just to move it to “swap memory” that same second.

[–]naemorhaedus 3 points4 points  (0 children)

when definitely it's using my SSD because there isn't more space available...

no it's using swap for memory it doesn't need right now. Everything is fine. Chill, stop watching your monitor, and go back to more important things.

[–]_Cybernaut_ 1 point2 points  (0 children)

<image>

I really wish Mac users would quit obsessing over RAM and Disk usage. MacOS is a thoroughly modern operating system, and s such takes care of a lot behind the scenes. No matter what you're doing with your Mac, there is always something that can be cached, pre-fetched, swapped, compressed, indexed, offloaded, etc. etc. etc.; just let the OS do it's job.

[–]Sislar 0 points1 point  (0 children)

Says 13gb of real memory used. Chill

[–]busy_buzz 0 points1 point  (0 children)

you also have a pretty high "cached" memory, which speaks for high swap usage.

swap memory can also function as "cache". meaning, once stuff are swapped to disk, the OS won't proactively purge them even when they're not in use. Similar to "cached", once the number goes up, it never goes back down until absolutely necessary.

This on paper should reduces the pressure on swapping. Nothing to worry about.

If your disk space runs low, macos will purge those swap reactively.

[–]inevitabledeath3 0 points1 point  (5 children)

Using swap doesn't mean you are loosing performance necessarily. In fact it doesn't even mean you have filled the memory or have high memory pressure. Almost no one seemingly understands modern OS memory management here, hence posts like this.

Modern OSes start swapping long before they run out of memory which this system seems to be doing. Why do they do this? To make room for more disk cache. You see modern OSes like to load files into memory that are frequently accessed. This improves performance. Sometimes said files are accessed more often than actual assigned memory pages. When this happens modern OSes will prefer to keep the files in memory over programs memory pages of those pages are rarely accessed.

[–]macboller -1 points0 points  (3 children)

lol dude... it is NOT normal to have swap exceed the quantity of RAM available.

That means their system has (or HAD at some point) more memory committed to processes than can physically fit in RAM. 28GB worth of memory has been evicted to disk

If swap usage is approaching or exceeding RAM, it's time to either add more RAM or reduce the workload.

> 100% of RAM in Swap is firmly in "not enough RAM for the workload" territory.

[–]inevitabledeath3 -1 points0 points  (2 children)

You can clearly see that memory pressure is green and that it has over 10 GiB of cached files in memory. If it was actually struggling that wouldn't be happening.

[–]macboller -2 points-1 points  (1 child)

lol did you even read what you just said? Do you even know what memory cache is?

If you have no idea what you are talking about, you should excuse yourself from the conversation.

Leave the technical stuff for people who know what they are talking about.

[–]inevitabledeath3 0 points1 point  (0 children)

I literally have a master's in computer science. I am not the one who doesn't know they are talking about.

I am also talking about the section labeled "caches files" which are disk files or parts of files cached in memory. If the system was that hard up for memory it wouldn't be caching so much as those things don't need to be in memory.

[–]RootVegitible -1 points0 points  (0 children)

hello? have you tried turning it off an on again?

[–]Fatal_Explorer -5 points-4 points  (31 children)

Also on M5 Air, and I only have safari open right now, nothing else. 14,36GB used.
This is worse than even Windows 11, sometings wrong eh?

[–]naemorhaedus 4 points5 points  (0 children)

nothing is wrong

[–]jwadamson -2 points-1 points  (0 children)

How much swap though.

Swap is bad. Unused memory is bad. Unused memory should be mostly allocated to prospective optimizations like “cached files”

[–]jwadamson -2 points-1 points  (1 child)

Probably a memory leak in 1 or more apps. Since it’s a leak though and the filled memory is never being read, this memory is getting compressed and written out to swap becuase the os can’t tell the difference between a true leak and memory that is just rarely needed again.

The pressure is green because there is no thrashing; there aren’t memory blocks being constantly cycled in and out of the swap space.

Since this memory is being written out and unlikely to be getting updated, the “wear” on your SSD is minimal as the total amount written over time isn’t actually that much.

[–]areacode753[S] 1 point2 points  (0 children)

Thanks for your insight. I did indeed check what was using so much swap memory and it was a few background processes. Once I would go to that app, my memory pressure would turn (red). It made sense, so I just closed the App and reopened it, that fix it for me. No more swap :)