Controlling memory usage
Let's start by having Vicky do something that will hog all of the system memory. As before, we'll use the stress-ng
utility to simulate that, like this:
vicky@ubuntu2004:~$ stress-ng --brk 4
Wait a few moments, and you'll see some fairly ugly things in the top
display:
Yeah, only 98.9 bytes of free memory, and super-high load averages. In fact, after about 2 minutes or so, this virtual machine is completely unresponsive to any commands. Ouch!
Now, understand that I still have the 200% CPUQuota
set for Vicky. So, CPU usage isn't the problem here. The load average is a representation of how many tasks are waiting to be serviced by the CPU. In the top part of the top
display, as shown in Figure 12.9, the 53.51
that you see is the 1-minute average, 46.38
is the 5-minute average, and 25.00
is the 15-minute average. These load averages are...