Does Darwin (MacOS kernel) do memory overcommit

mac-osx

For example, Linux has vm.overcommit_memory which is on by default. Windows does not have memory overcommit. Does MacOS? Is it configurable? What's the default setting?

Best Answer

I've tested on my MacOS and it's working. I use code from this question. And system allow me allocate more then 40Gb memory, with only 16Gb RAM onboard and 6Gb used swap(on picture process of allocation before OOM-killer execution).

Activity monitor

My kernel version is:

Darwin AT-MacBook-Pro-2.local 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar  3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64

I don't found possibility to configure overcommit, but look like by default it 2. But we should remember, that MacOS have dynamic swap and it compress memory, so my assumption could be wrong.

Related Topic