What are the methods for checking memory usage in Linux?

  1. By using the “free” command in the terminal, you can check the system’s memory usage, including used memory, available memory, cache, and swap space information.
  2. Utilize the top command: Inputting the top command in the terminal allows you to view the real-time memory usage of processes in the system, sorted by memory usage.
  3. The htop command is used to display a list of running processes on the system and their resource usage, including memory usage.
  4. Using the vmstat command: Typing the command “vmstat” in the terminal allows you to check the system’s virtual memory usage, including information on active, inactive, buffered, and swapped memory.
  5. Use the command ‘cat /proc/meminfo’ to check the system’s memory usage, including total memory, free memory, cache, and swap space information, by viewing the content of the /proc/meminfo file.
  6. By using the sar command, you can check the system’s resource usage, including memory and CPU usage, by installing the sysstat package.
bannerAds