All pastes #278151 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-12-13 21:49 UTC
rendered paste body
import gc

def collect():
  print "Collecting:", gc.collect()
  print "Object count:", len(gc.get_objects())
  print ""

collect()

def _getclass(ctr):
  class Foo(object):
    count = ctr

  return Foo()

n = 1000

for x in xrange(100):
  print "%d-%d Foos for fun" % (x*n, (x*n)+n)
  results = []
  for i in xrange(x*n, (x*n)+n):
    results.append(_getclass(i))

  results = None

  collect()