title: Python multiprocessing - How to release memory when a process is done?
body: <p>I encountered a weird problem while using python multiprocessing library. </p>
  
  <p>My code is sketched below: I spawn a process for each "symbol, date" tuple. I combine the results afterwards. </p>
  
  <p>I expect that when a process has done computing for a "symbol, date" tuple, it should release its memory? apparently that's not the case. I see dozens of processes (though I set the process pool to have size 7) that are suspended¹ in the machine. They consume no CPU, and they don't release the memory. </p>
  
  <p>How do I let a process release its memory, after it has done its computation?</p>
  
  <p>Thanks!</p>
  
  <p>¹ by "suspended" I mean their status in ps command is shown as "S+"</p>
  
  <pre><code>def do_one_symbol( symbol, all_date_strings ):
      pool = Pool(processes=7)
      results = [];
      for date in all_date_strings:
          res = pool.apply_async(work, [symbol, date])
          results.append(res);
  
      gg = mm = ss = 0;
      for res in results:
          g, m, s = res.get()
          gg += g; 
          mm += m; 
          ss += s;
  </code></pre>