Created
June 6, 2019 16:27
-
-
Save toby-p/d16eb193896997b6eb45595adbfd4e71 to your computer and use it in GitHub Desktop.
Function to track current memory usage.
This file contains hidden or 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 os, psutil | |
# Tool for tracking memory usage: | |
def usage(): | |
process = psutil.Process(os.getpid()) | |
print(process.memory_info()[0] / float(2 ** 20)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment