title: Python garbage collector documentation
body: <p>I'm looking for documents that describes in details how python garbage collection works.</p>
  
  <p>I'm interested what is done in which step. What objects are in these 3 collections? What kinds of objects are deleted in each step? What algorithm is used for reference cycles finding?</p>
  
  <p>Background: I'm implementing some searches that have to finish in small amount of time. When the garbage collector starts collecting the oldest generation, it is "much" slower than in other cases. It took more time than it is intended for searches. I'm looking how to predict when it will collect oldest generation and how long it will take.</p>
  
  <p>It is easy to predict when it will collect oldest generation with <code>get_count()</code> and <code>get_threshold()</code>. That also can be manipulated with <code>set_threshold()</code>. But I don't see how easy to decide is it better to make <code>collect()</code> by force or wait for scheduled collection.</p>