linux check memory usage per process code example
Example 1: what process consuming RAM
ps -o pid,user,%mem,command ax | sort -b -k3 -r
Example 2: how to check which process is using more memory in linux
ps aux --sort=-%mem | head
ps -o pid,user,%mem,command ax | sort -b -k3 -r
ps aux --sort=-%mem | head