LFS201 - Chapter 13 Discussion // Questions // Banter
Regarding the OOM killer, we tried to use stress-ng to fill the memory and get the oom killer to work.
I had suggested to use dd as follows:
[email protected]:~$ dd if=/dev/urandom of=/tmp/bigfile bs=4096
dd: error writing '/tmp/bigfile': No space left on device
6346336+0 records in
6346335+0 records out
25994588160 bytes (26 GB, 24 GiB) copied, 451.941 s, 57.5 MB/s
[email protected]:~$ free
total used free shared buff/cache available
Mem: 49351760 17871876 3011112 117328 28468772 30762084
Swap: 999420 0 999420
I guess in my case the root file system filled before I hit the memory limit. My VM has 48Gig and the entire file system is only ~50Gig. Should have run the VM with less memory.
But in general this method also seems to work, but it takes more time.
Another observation, during the Thursday session, when using stress-ng we saw that the oom killer actually terminated the stress-ng program.
If you look at:
[email protected]:~$ cat /proc/sys/vm/oom_kill_allocating_task
"If set, the oom-killer kills the task that triggered the out of memory situation, rather than trying to select the best one." That might explain why the stress-ng program was killed.