Skip to content

Instantly share code, notes, and snippets.

@aleiphoenix aleiphoenix/app.py
Created Apr 24, 2015

Embed
What would you like to do?
Python garbage collection statistics...
# -*- coding: utf-8 -*-
import gc
s = {}
for i in gc.get_objects():
_ = str(type(i))
if _ in s:
s[_] += 1
else:
s[_] = 1
def filter(_):
k, v = _
if v > 100:
return (k, v)
for item in map(filter, s.items()):
if item:
print(item[0], item[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.