Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Check memory usage in python
#standard module
# peak memory usage (kilobytes on Linux, bytes on OS X)
import resource
# pip install psutil
import os, psutil; print(psutil.Process(os.getpid()).memory_info().rss / 1024 ** 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment