4 ms·
Apparently, with the unified memory, Apple has taken the approach that unused RAM is useless RAM. Therefore, the system is greedy at allocating RAM and will rel
by lemonwaterlime 2y ago
Apparently, with the unified memory, Apple has taken the approach that unused RAM is useless RAM. Therefore, the system is greedy at allocating RAM and will release it to higher priority processes as they request it. Your system at baseline will always use "a lot" of RAM. This is to be expected.
- justinclift 2y agoSo why does the picture show ~1/2GB of swap in use?
- kergonath 2y agoMacOS is a bit enthusiastic about swap (and memory compression) and won’t necessarily take stuff out of swap before it is actually needed. That’s why you can have both available RAM and non-zero swap use.
- gruez 2y ago>Therefore, the system is greedy at allocating RAM and will release it to higher priority processes as they request it. Can this be substantiated? "the system is greedy at allocating RAM and will release it to higher priority processes as they request it" is cold comfort to someone with 10 chrome tabs open and the system freezing up as a result.
- varenc 2y ago> Can this be substantiated? Sort of. Use the `memory_pressure` CLI tool. You can use it to just simulate a critical memory warning and you’ll immediately see the system free up a lot of RAM. In macOS parlance the key metric is “memory pressure”. From the tweet’s screenshot you can see memory pressure is only about 20%.
- gruez 2y ago>In macOS parlance the key metric is “memory pressure”. From the tweet’s screenshot you can see memory pressure is only about 20%. I searched around[1][2] and it's unclear how the chart is actually derived. It should therefore be treated with suspicion, along with other opaquely defined metrics like wework's "community EBITDA". [1] https://apple.stackexchange.com/questions/202744/what-is-memory-pressure-and-how-do-i-relieve-it https://apple.stackexchange.com/questions/202744/what-is-mem... [2] https://web.archive.org/web/20200415041837/https://support.apple.com/en-us/HT201464 https://web.archive.org/web/20200415041837/https://support.a...
- varenc 2y agoEh this feels like a false comparison. Memory pressure is an internal macOS system metric not some public facing self aggrandizing metric. It’s not like Apple has marketing material like “idles at 20% memory pressure!”. I’m sure it’s explicitly and deterministically defined somewhere at least.
- justinclift 2y ago> Memory pressure is an internal macOS system metric Interesting. That'll probably mean it's in the source code Apple publishes for macOS: https://github.com/apple-oss-distributions/distribution-macOS https://github.com/apple-oss-distributions/distribution-macO... Doing a search for the phrase "memory pressure" in the containing organisation (apple-oss-distributions) shows some relevant stuff: https://github.com/search?q=org%3Aapple-oss-distributions+%22memory+pressure%22 https://github.com/search?q=org%3Aapple-oss-distributions+%2... • memorystatus.md : https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/doc/vm/memorystatus.md?plain=1#L3 https://github.com/apple-oss-distributions/xnu/blob/94d3b452... # Memorystatus Subsystem Dealing with memory pressure by forcibly recovering pages. (etc) • memory_pressure.1 : https://github.com/apple-oss-distributions/system_cmds/blob/1bca46ecc5b76432f42eb23ec39fe63e8159f251/memory_pressure/memory_pressure.1#L8 https://github.com/apple-oss-distributions/system_cmds/blob/... Looks like the man page for a `memory_pressure` command • freezer.md : https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/doc/vm/freezer.md?plain=1#L8 https://github.com/apple-oss-distributions/xnu/blob/94d3b452... # Freezer Details of how some processes can be swapped out to disk. [...] The freezer is a limited form of swap on embedded. Under memory pressure, the freezer picks apps to freeze. (etc) And a whole bunch more. With some digging, it should be possible to find the exact info. :)
- kergonath 2y agoThat is a sensible approach, to be honest. RAM is there to be used, not to increase the stats when the computer is idle. Doesn’t Windows do more or less the same thing? I know my Linux workstation is caching a lot of stuff in the available memory as well.
- Dalewyn 2y ago>Doesn’t Windows do more or less the same thing? Yes, since at least Windows Vista it's been very aggressive about caching into free RAM. It isn't complained about that often because Windows counts that RAM as "standby" RAM together with free RAM.
- gruez 2y agoIf you check the screenshot, you'll clearly see that "cached files" is reported separately and doesn't count towards "memory used".
- boomboomsubban 2y ago>doesn't count towards "memory used". Where does it indicate that?
- gruez 2y ago1. there's a notch to the right of "memory used", indicating that what's to the right of it makes up "memory used" 2. "app memory", "wired memory", and "cached files" added together exceeds "memory used", suggesting that not all of them can make up "used memory". 3. apple's own docs: https://web.archive.org/web/20200415041837/https://support.apple.com/en-us/HT201464 https://web.archive.org/web/20200415041837/https://support.a...
- boomboomsubban 2y agoFor 1 and 2, "cached" could refer to a portion of app and/or wired memory used that is available to be reused. It's not clear from the screenshot what cached means. 3 isn't in the screenshot, but does vaguely imply cached and app memory are different. It doesn't directly say whether cached is counted in memory used though. The linked "for more information" makes it less clear. For example, how does purgeable memory fit into the "app memory" "wired memory" and "cached files" distinction? In another post you mention having ten tabs opening and the system freezing. If that's happening, there's probably a memory issue. I'm not sure Mac's resource monitor showing ~half your memory "used" means there is a problem.
- thefz 2y agoEager caching is an OS feature, not a RAM feature.