Hooking into Python's memory management

Daniel Neilson ddneilson at gmail.com
Thu May 5 01:30:47 EDT 2011


  Thanks for the feedback, everyone. I spent some time today playing 
around with the gc module, and came to the same conclusion that many of 
you have as well.

for o in gc.get_objects():
	print(o)

  was sufficient to convince me that I didn't want to go that route.

  Writing a simple memory pool/heap that students will have to use to 
allocate/deallocate objects of a particular type definitely seems the 
way to go. It will get the ideas across, and allow them to contrast the 
garbage collection and explicit memory management paradigms.

-Daniel



More information about the Python-list mailing list