This is the Linux out of memory manager (OOM). Restrict memory any process can consume (for example JVM memory can be restricted using JAVA_OPTS).Find the memory leaks in your program and fix them.Either /var/log/kern.log or /var/log/dmesg Typically which process uses more memory becomes the victim to be killed. OOMKiller has its own algorithm to score the rank for every process. So it will try to free some memory calling/invoking OOMKiller ( ). Kernel check for the available memory and find that there is no way it can allocate your process more memory. Now say any process has requested large chunck of memory from the kernel. But all of sudden (or gradually) your system has started consuming more and more memory and it reached at a point around 95% of total memory used. Now, for some time everything is running fine within 1.5GB of total memory. So in theory, your CPU has access to total of 1.5GB of virtual memory. Let me first explain when and why OOMKiller get invoked? The great thing about this is that it includes some commentary on the reasoning behind the various badness() rules. It's all described in the article in a lot more detail.Įdit: And here is ( 2) that explains pretty well how a process is chosen (annotated with some kernel code examples). The process to be killed is based on a score taking into account runtime (long-running processes are safer), memory usage (greedy processes are less safe), and a few other factors, including a value you can adjust to make a process less likely to be killed. However, once processes start using this memory, Linux might realize that it has been too generous in allocating memory it doesn't have, and will have to kill off a process to free some up. This makes allocation quick, and might allow you to "cheat" and allocate more memory than you really have. The process will get exclusive use of the memory it has allocated when it actually uses it, not when it asks for it. When a process asks for more space, Linux will give it that space, even if it is claimed by another process, under the assumption that nobody actually uses all of the memory they ask for. The gist is that Linux overcommits memory. This looks like a good article on the subject: Taming the OOM killer ( 1).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |