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.
を使用するps -o pid,rss -p 1と、次のように表示されます。
ps -o pid,rss -p 1
PID RSS 1 784
しかし、 with をクエリするrssとpsutil、別の値が得られます。
rss
psutil
>>> p = psutil.Process(1) >>> print p.get_memory_info().rss 802816
psutil別のユニットを使用することは可能ですか?ドキュメントに関連情報が見つかりません。
ps の出力はキロバイト単位です。psutil からの RSS (常駐セット サイズ) はバイト単位です。
>>> 802816 / 784 1024
からman ps:
man ps
rss RSS resident set size, the non-swapped physical memory that a task has used (in kiloBytes). (alias rssize, rsz).