1. top command
top -d 1 -p pid [,pid ...]//Set to delay 1s, default is delay 3s
If you want to sort by memory usage, you can shift + m (Sort by memory usage)
2. /proc/<pid>/status View the memory usage of the process
You can view the virtual memory size (VmSize), physical memory size (VmRSS), data segment size (VmData), stack size (VmStk), code segment size (VmExe), shared library code segment size (VmLib), etc. .