title: How can I find memory leaks in my Python program?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/110259/python-memory-profiler">Python memory profiler</a>  </p>
  </blockquote>
  
  
  
  <p>I've got a fairly complex (about 20,000) line Python program which after some development has started consuming increasing amounts of memory when it runs. What are the best tools and techniques for finding out what all the memory is being used for?</p>
  
  <p>Usually this comes down to either unexpectedly keeping references to objects, or extension module bugs (which isn't particularly likely since we've been using the Python 2.4 installation for a while).</p>
  
  <p>We are using various third party libraries such as Twisted, Twisted Conch and MySQLdb.</p>