Back to DaemonApplication class

Method gc

protected void
gc
()
Method to perform basic garbage collection and memory management in the sense of clearing the stat cache. We will probably call this method pretty regularly in our main loop.
Returns
  • void
Since
  • 1.7.0

Method gc - Source code

/**
 * Method to perform basic garbage collection and memory management in the sense of clearing the
 * stat cache.  We will probably call this method pretty regularly in our main loop.
 *
 * @return  void
 *
 * @since   1.7.0
 */
protected function gc()
{
    // Perform generic garbage collection.
    gc_collect_cycles();
    // Clear the stat cache so it doesn't blow up memory.
    clearstatcache();
}