Monitoring memory usage
Understanding how Linux manages memory can actually be a somewhat complex topic, as understanding how much memory is truly free can be a small hurdle for newcomers to overcome. There's even a website dedicated to the topic of Linux RAM usage, which features a rather hilarious leading graphic: http://www.linuxatemyram.com/.
You'll soon see that how Linux manages memory on your server is actually fairly straight forward. For the purpose of monitoring memory usage on our server, we have the free command at our disposal, which we can use to see how much memory is being consumed at any given time. My favorite variation of this command is free -m
, which shows the amount of memory in use in terms of megabytes. You can also use free -g
to show the output in terms of gigabytes, but the output won't be precise enough on most servers. Giving the free command no option will result in the output being shown in terms of kilobytes: