Linux Memory Usage

To display the memory used by applications in Linux, you can use the ps command with the aux option. To sort the list by memory usage, you can use the –sort option and specify the rss (resident set size) field. The resident set size is the amount of memory that is currently being used by a process, in kilobytes.

Here is an example of the ps command with the –sort option:

  
ps aux --sort -rss
  

This will display a list of processes sorted in descending order by memory usage.

You can also use the top command to display a real-time view of the memory usage of processes on the system. The top command displays a list of processes, along with their CPU and memory usage, and updates the list periodically.

To sort the list by memory usage, you can press the M key.

Category : Knowledge Base