title: destroy object in php
body: <p>I am executing a program in PHP and getting the below error sometimes.Is this due to creating lot's of objects and not destroying them or any other reason?</p>
  
  <p>Allowed memory size of 16777216 bytes exhausted (tried to allocate 19456 bytes)
  What is the correct method to destroy an object in PHP5.</p>
  
  <p>Some code:</p>
  
  <pre><code>App::import('Vendor','GoogleShipping',array('file'=&gt;'googlecheckout'.DS.'library'.DS.'googleshipping.php'));
  App::import('Vendor','GoogleTax',array('file'=&gt;'googlecheckout'.DS.'library'.DS.'googletax.php'));
  class Cart{
      var $_itemname;
      var $_unit_price;
      public function Usecase($itemname,$unit_price,$url,$merchant_private_item_data)
      {
              $cart = new GoogleCart($this-&gt;_merchant_id, $this-&gt;_merchant_key, $this-&gt;_server_type,$this-&gt;_currency);
              $item_1 = new GoogleItem($this-&gt;_itemname,$this-&gt;_item_description,$this-&gt;_total_count,$this-&gt;_unit_price,$this-&gt;_merchant_private_item_data);
      }
  }
  </code></pre>