Skip to content

Instantly share code, notes, and snippets.

@jimjh
Last active February 23, 2020 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimjh/f5e1bb90f3bf771228844f3ee9ff8b99 to your computer and use it in GitHub Desktop.
Save jimjh/f5e1bb90f3bf771228844f3ee9ff8b99 to your computer and use it in GitHub Desktop.
Measuring the amount of memory used by PyMySQL
$ python -m memory_profiler mysql.py
Filename: mysql.py
Line # Mem usage Increment Line Contents
================================================
4 19.375 MiB 19.375 MiB @profile
...
7 19.742 MiB 0.367 MiB connection = pymysql.connect(...)
...
13 19.742 MiB 0.000 MiB connection.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment