Top 7 uses of The “free” command for monitoring Linux Memory Usage
Hey there! Welcome to the world of Linux freaks and best use of “free” Linux command. Imagine you are almost done with your job and suddenly an incident is logged for abrupt process termination due to lack of memory in production! It’s a nightmare.
But let’s see how we can gauge the memory usage in Linux. Please note that,I am not going with “how to Troubleshoot the Above Problem” . Rather I intent to show you demonstration of free command. As usual, lets see what the usual man page has to say about the “free” command.
So, we can clearly understand from the above output that the free command tells the used and the free primary memory (Basically RAM) of your system. Also, It parses ‘/proc/meminfo’ for the same. So, let’s see what other things this files care for?
But, imagine you are stuck in prod issue and you want to quickly find out th memory usage. so how do you get the “only necessary information” or parameter for the same ? Here comes the ‘free’ for you. Let’s see the output.
- Show Memory Usage
2. Show me more human
3. Lets -m for Megabyte, -g for Gigabyte and -b for byte and You can guess more
4. Let’s total the Swap space and Memory space in Gigabyte
5. Let’s monitor for particular interval
6. show detailed low and high memory statistics
7. Help yourself for free
There are many use cases, but we as a Server guy try to play and move around with this commands. Feel free to use The free command freely (Not in prod chap! :wink: )