title: R, the environment of mclapply and removing variables
body: <p>I am having trouble understanding the behave of mclapply (or maybe something else).</p>
  
  <p>I do something like:</p>
  
  <pre><code>opt.Models = mclapply(1:100, mc.cores=20, function(i){
      res = loadResult(reg, id=i)    
      return(post.Process(res))
    })
  </code></pre>
  
  <p><code>loadResult</code> loads <strong>one</strong> result from a earlier saved BatchJob session. So, the <code>res</code> object needs ~170MB (roughly all 100 objects are the same size +/-5MB).
  When executing the piece of code, the memory footprint is as expected: 170MB*20= ~3.5GB (I used 20 cores).
  When executing this piece of code for the second time, my machine inhales a vast amount of memory (more than available - so I stop execution). What is expected because, again, <code>mclapply</code>forks the complete environment for each child and my environment now has the big <code>opt.Models</code> variable with ~10GB. Therefore 10*20=200GB would be required.</p>
  
  <p>When I remove opt.Models, <code>rm(opt.Models)</code>, I still run into the same problem. mclapply consumes more memory than available (btw: 90GB).
  So, which environment does mclapply fork, or isn't opt.Models totally gone? I can't see it using <code>ls()</code>.</p>
  
  <p>Maybe one of you has observed something similar.</p>
  
  <p>Best regards,</p>
  
  <p>Mario</p>