During the whole time of using linux distributions I noticed that if some program had a memory leak or I accidentally left for example htop with strace open for a day, the system would hang tight when the memory was exhausted and it would not be possible to switch to the console or for example turn it on / off " Caps Lock "(the indicator on the keyboard just will not change its state).
Hangup occurs gradually during the process of memory exhaustion, iowait first rises and it becomes noticeable that the system slows down a bit, then with continued memory exhaustion, iowait tends to 100% and the system starts to hang more, and then completely tightly and almost irrevocably, in the process of memory exhaustion and raising the iowait in parallel, it begins to keep the active indicator of the drive, up to constant activity, without changing the state, longer and longer.
You can "hang" only by freeing up somehow the memory, with the complete freezing of the system I got it only by pressing the "System Request" key sequence (they should be included in the sysctl) - ALT-SysRQ-F, this causes the OOM Killer, it frees the memory and the system gradually begins to go into normal operation, the OOM Killer itself without pressing this combination is called only when the memory overcommit is disabled via sysctl, and with the memory overcommit turned on, the OOM Killer does not work, how much would I not wait and how I did not try to configure the sysctl parameters.
All those who I wouldn’t have asked in essence couldn’t answer me, they just suggested to increase my count. I don’t have any problems with this problem, it’s enough for me and the situation with freezing occurred only in emergency situations.
I have a theory that the kernel starts cycling off some caches to disk in search of free memory and freezes because of this, but this is just a theory, I would like to read the explanations from a person who understands this.
PS This of course all happens when swap is disabled.

  • I am also interested in this question. If you figured out, then you could have written the answer. - Soprano
  • And my program in segfault falls when the memory runs out - eri

0