Created
June 18, 2020 10:54
-
-
Save meysampg/633afc473ca3f749001883185622c598 to your computer and use it in GitHub Desktop.
Showing memory usage info as debug on logging
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 logging | |
from pympler import muppy, summary | |
def mem_leak(): | |
all_objects = muppy.get_objects() | |
sum1 = summary.summarize(all_objects) | |
logging.debug("\n" + "\n".join(list(summary.format_(sum1)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment