| 参数 | vm.overcommit_memory |
|---|---|
| 取值 | 0 启发式(默认) / 1 总是允许 / 2 严格模式 |
| 严格模式 | 配合 vm.overcommit_ratio 或 overcommit_kbytes 计算 CommitLimit |
查看与设置
查看与设置
sysctl vm.overcommit_memory
sysctl -w vm.overcommit_memory=1
cat /proc/meminfo | grep -E 'CommitLimit|Committed_AS'Redis 官方文档建议将其设为 1,以避免后台 fork 持久化时受启发式判断影响(公开文档建议)。