title: Symfony task - memory leak
body: <p>I wrote a symfony task to fill a database of sample data. Here's a sample piece of code:</p>
  
  <pre><code>gc_enable();
  Propel::disableInstancePooling();
  
  public function test()
  {
      for($i = 0; $i &lt; 10000; $i++) {
          $this-&gt;doIt($i);
      }
  }
  
  public function doIt($i)
  {
      $user = new User();
      $user-&gt;setUsername('user' . $i . "@example.com");
      $user-&gt;setPassword('test');
      $user-&gt;setFirstName('firstname' . $i);
      $user-&gt;setLastName('surname' . rand(0, 1000));
  
      $user-&gt;save();
      $user-&gt;clearAllReferences(true);
      $user = null;
      gc_collect_cycles();
  }
  </code></pre>
  
  <p>How can I limit the use of memory?</p>