Skip to content

Instantly share code, notes, and snippets.

@toby-p
Created June 6, 2019 16:27
Show Gist options
  • Save toby-p/d16eb193896997b6eb45595adbfd4e71 to your computer and use it in GitHub Desktop.
Save toby-p/d16eb193896997b6eb45595adbfd4e71 to your computer and use it in GitHub Desktop.
Function to track current memory usage.
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