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.
我在 linux (c++ 代码) 中运行一个可执行文件。我想计算这个可执行文件的“平均”工作集大小?我不知道如何进行。有人可以帮我吗?
linux中是否有任何命令可以这样做?
提前致谢
凯撒的灵感:
pid=`ps axo 'pid,ucomm' | grep procname | awk '{print $1;}'` while sleep 15; do grep VmRSS /proc/$pid/status || break; done > /tmp/size awk '{ sum += $2; count++; } END { print sum/count; }' /tmp/size