title: How to profile a cron task in Magento
body: <p>I have a cron task in Magento that I need to profile to determine memory usage problems. The script runs during the night, and crashes after half an hour or so due to consuming all available memory.</p>
  
  <p>I need to profile the script to determine which functions are consuming too much memory.</p>
  
  <p>I have tried using the <a href="http://www.fabrizio-branca.de/magento-profiler.html" rel="nofollow">Aoe_Profiler</a>, but when trying to profile a cron task, there is nowhere to view the output, as the cron task does not invoke the MVC, thus the profiler's view block can't be rendered.</p>
  
  <p>How can a cron task be profiled in Magento?</p>