这是我当前的设置:
vm.overcommit_ratio = 50 (default)
vm.overcommit_memory = 2
Run Code Online (Sandbox Code Playgroud)
和当前内存使用情况:
[localhost~]$ free -g
total used free shared buffers cached
Mem: 47 46 0 0 0 45
-/+ buffers/cache: 1 45
Swap: 47 0 47
Run Code Online (Sandbox Code Playgroud)
根据文档我的理解是:
vm.overcommit_memory = 2
不允许过度使用内存超过 RAM 的 50% (as vm.overcommit_ratio is 50)
,但我仍然可以看到当前内存使用量为 47 GB 中的 46 GB。
我是不是误会了什么?