#! /usr/bin/python DEBUG = True import urllib2 import gc import time import os urltotest = 'http://www.google.com' if DEBUG is True: gc.enable() gc.set_debug(gc.DEBUG_LEAK) i=0 while i < 100: i += 1 fn = urllib2.urlopen(urltotest) blah=fn.readlines() fn.close() time.sleep(1) if DEBUG is True: gc.collect() print "unreachable objects: ",len(gc.garbage) a=os.system("./monitor")