Skip to content

Instantly share code, notes, and snippets.

@runningzyp
Created November 10, 2021 03:42
Show Gist options
  • Save runningzyp/c97d46f45da8cf360f193dd50e23fc13 to your computer and use it in GitHub Desktop.
Save runningzyp/c97d46f45da8cf360f193dd50e23fc13 to your computer and use it in GitHub Desktop.
内存占用
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