\begin{exe} {Invoking the OOM Killer}

   Examine what swap partitions and files are present on
   your system by examining \filelink{/proc/swaps}.

   Turn off all swap with the command

   \begin{cmd}
$ sudo /sbin/swapoff -a
   \end{cmd}
   Make sure you turn it back on later, when we are done,
   with
   \begin{cmd}
$ sudo /sbin/swapon -a
   \end{cmd}

   Now we are going to put the system under increasing
   memory pressure. One way to do this is to exploit the
   \textbf{stress-ng} program we installed earlier, running it
   with arguments such as:

   \begin{cmd}
$ stress-ng -m 12 -t 10s
   \end{cmd}
   which would keep 3 GB busy for 10 seconds.

   You should see the \textbf{OOM} (Out of Memory) killer
   swoop in and try to kill processes in a struggle to stay
   alive. You can see what is going on by running
   \textbf{dmesg} or monitoring
   \filelink{/var/log/messages} or
   \filelink{/var/log/syslog}, or through graphical
   interfaces that expose the system logs.

   Who gets clobbered first?

\end{exe}

