Created
November 10, 2021 03:42
-
-
Save runningzyp/c97d46f45da8cf360f193dd50e23fc13 to your computer and use it in GitHub Desktop.
内存占用
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psutil | |
import os | |
print( | |
"当前进程的内存使用:%.4f GB" | |
% (psutil.Process(os.getpid()).memory_info().rss / 1024 / 1024 / 1024) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment