Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想要一个 bash 脚本来计算特定应用程序或命令使用的内存量。
ps o rss= -p PID将输出给定进程的驻留集大小。
ps o rss= -p PID
使用size而不是rss获取代码+数据+堆栈大小。
size
rss
可能的方式:
在终端中使用top,然后将输出通过管道传输到文件中并获取您需要的行(grep)
top