1. Basic command to monitor memory in linux
All you need stored in this file – EVERYTHING:
# cat /proc/meminfo
Easier way to view memory usage :
Show cpu, memory, up time and process status
# top
Easy command to see free memory
# free -m
# free -k
2. Advance
In a server with lager memory installed, disk cached memory may make you comfused.
To see memory in cached, use this command
# cat /proc/meminfo | grep Cached
To count real memory in used by every process, try count in top command’s result
# ps aux | awk ‘{sum +=$4}; END {print sum}’
Hope this is helpful !