In addendum to my previous post... I have a 32GB RAM machine. My activity monitor tells me that around 14GB is used. But RAM usage figures like that are misleading. Memory management is complicated. If you want to know the real story, run vm_stat in terminal. Here is my output:
Code:
Mach Virtual Memory Statistics: (page size of 4096 bytes)
Pages free: 5037986.
Pages active: 692710.
Pages inactive: 517411.
Pages speculative: 170655.
Pages throttled: 0.
Pages wired down: 1059250.
Pages purgeable: 103287.
"Translation faults": 364549965.
Pages copy-on-write: 32137712.
Pages zero filled: 207605660.
Pages reactivated: 1291175.
Pages purged: 1786586.
File-backed pages: 379257.
Anonymous pages: 1001519.
Pages stored in compressor: 4466825.
Pages occupied by compressor: 909627.
Decompressions: 5223109.
Compressions: 11739615.
Pageins: 8514093.
Pageouts: 18383.
Swapins: 8094925.
Swapouts: 9222849.
The "real" occupied RAM is active (stuff currently allocated by running applications) and wired (mision-critical kernel memory). In total I have 1751960 such memory pages (4KB each). This is just under 7GB. And I have around 50 tabs open in Safari, Xcode + 3 coding editors open, Steam, Keynote, Mail, Calendar, two different R-Studio sessions, Notes, iTunes, Numbers, Zoom, and 20+ open PDFs in Preview....
Note also that there are almost as many inactive pages than there are active! Inactive memory is memory that has been freed by applications, but OS decided not to purge it "just in case" (e.g. maybe you re going to start the same app again soon, then macOS won't need to reload it from disk). Also, just under 1GB is "speculative" — OS deciding to preload frequency used apps etc. in case I would want to use them. This is just after wake up btw, inactive and speculative pages tend to grow if your machine is awake for a while. Thats where your RAM is going if you have plenty of it and that is what people mean by "macOS tries to utilize the RAM you have". RAM usage figures are mostly meaningless. Memory pressure is the most useful statistic for a consumer.
So yeah, RAM management is
hard. You need to understand how OS operates to understand how RAM is used.
[automerge]1592733354[/automerge]
Close the tabs and programs you don't use, you lazybones.
You don't even need to do this. The OS is very good at detecting what you don't use and will compress/purge/offload these things. You probably won't even notice anything. Maybe some minor delay when switching to a tab you haven't used in a while. But then again, the switching animation takes longer than to reload the data from the SSD.