title: Iteration over pool.imap_unordered
body: <p>Consider very simple code:</p>
  
  <pre><code>#!/usr/bin/python
  
  from multiprocessing import Pool
  import random
  
  def f(x):
      return x*x
  
  def sampleiter(n):
      num = 0
      while num &lt; n:
       rand = random.random()
       yield rand
       num += 1
  
  if __name__ == '__main__':
      pool = Pool(processes=4)              # start 4 worker processes
      for item in pool.imap_unordered(f, sampleiter(100000000000000), 20):
       print item
      pool.close
  </code></pre>
  
  <p>While running in the terminal, Python leaking memory.<br>
  What could be wrong?</p>