Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux OOM Killer 机制 #31

Open
jinhailang opened this issue Aug 7, 2018 · 0 comments
Open

Linux OOM Killer 机制 #31

jinhailang opened this issue Aug 7, 2018 · 0 comments
Labels

Comments

@jinhailang
Copy link
Owner

参考

理解LINUX的MEMORY OVERCOMMIT

使用技巧

某个程序因为系统内存不被杀掉了,此时,由于没有输出详细的堆栈信息,很难定位问题。
可以设置 overcommit_memory 参数,禁止系统启用 overcommit 机制(原理参考上面链接的文章)。

echo 2 > /proc/sys/vm/overcommit_memory

这样当系统内存不足时,程序就会主动 panic 从而输出 stack trace(以 Go 为例)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant