Unset ing class to clear memory
<p>I'm using <a href="http://www.jaisenmathai.com/articles/twitter-async-documentation.html" rel="nofollow">twitter-async</a> library to interact with twitter api. However, the memory limit keeps increasing even if I use <code>gc_enable()</code> and <code>gc_collect_cycles()</code> after various unset()s</p>

<p>Before using garbage collector, memory usage was too much. It has certainly decreased a lot. But not satisfactorily.</p>

<p>I'm running a for loop that checks for new requests in database and processes them.</p>

<p>Suppose, a request is processed, generating around 98 MB (this is fine -- considering the amount of data I'm fetching from twitter) of memory, and there are no more requests to be processed, then this 98 MB of data will stay forever until php reaches the 260MB memory limit I have setup. I've already setup monit that restarts the script if it crashes due to memory limit.</p>

<p>After investigating a bit, I found that the library saves data about failed calls,etc in some variables. Is there a way with which I can destroy the entire class that will unset all the memory-hungry variables and save the memory? I'm currently just unset()ing the variable for the class. </p>

<pre><code>$twitterObj = new EpiTwitter();
// Do all the stuff ..
unset($twitterObj);
</code></pre>

<p>But there still isn't any change in memory usage.</p>

<p>Help!</p>
