Memory is one of the most important features of any server. The more RAM a program uses, the less you will have available for other applications. Therefore, it is important to monitor memory usage on your Linux server to ensure that all programs are playing nice and that nothing wrong is going on.
1. /proc/meminfo – This file provides vital information about your system memory, virtual memory, swap, free memory, and much more. Run this command:
2. top – Top gives you an overview of the top programs that are using CPU and RAM. It also gives you an overall figure of how much memory and swap is being used. Run this command:
3. free – Free gives you information about how much memory has been used, how much is free, how much cache is used and much more. Run this command to use it:
free -m -t
(the flags will monitor the memory as well as the total usage)
Because memory is so important to your server, you should also be proactive and investigate the memory usage of programs before you install them. If you are not sure if a program might be a memory hog, do a little preliminary research first.