3 ms·
>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
by 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. :)
- varenc 2y agoWhoa great sleuthing! Also fun to see Apple internal documentation in .md format