How to avoid memory leaks in Symfony 2 Commands

http://konradpodgorski.com/blog/413/how-to-avoid-memory-leaks-in-symfony-2-commands/
http://www.alexatnet.com/articles/optimize-php-memory-usage-eliminate-circular-references