How To Check The Memory Usage Stats On Ubuntu Server Via Command Line
Following are some methods to check the memory usage in Ubuntu. More details about these tools can be found from the man pages.
free command displays amount of total, free and used RAM in the system, as well as shoing information on shared memory, buffers, cached memory and swap space used by the Linux kernel.
vmstat reports report virtual memory statistics, which has information about processes, swap, free, buffer and cache memory, paging space, disk IO activity, traps, interrupts, context switches and CPU activity. With vmstat command, administrators can has instantaneous reports on memory usage.
top command displays dynamic real-time view of the running tasks managed by kernel and system information in Linux system. The memory usage stats by top command include real-time live total, used and free physical memory and swap memory with their buffers and cached memory size respectively.
ps command reports a snapshot on information of the current active processes. Advantage of ps command is that system admins will be able to see where the memory is used. ps will show the percentage of memory resource that is used by each process or task running in the system. With this command, top memory hogging processes can be identified.