def do_debugmem(self, _line): """ Profile python memory usage. """ from guppy import hpy heap_stats = hpy() print(heap_stats.heap()) print() print(heap_stats.heap().byrcs)