Created
June 28, 2020 00:56
-
-
Save romicofre/13d839c998e6cafa948726916f9b99a0 to your computer and use it in GitHub Desktop.
Memory usage in MB
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
def memory_usage(): | |
""" | |
:return: memory usage in MB | |
""" | |
mem = psutil.Process(os.getpid()).memory_info().rss | |
return mem / 1024 ** 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment