Wednesday, April 13, 2011

Memory leak in Zend_Dom_Query::query()

http://zend-framework-community.634137.n4.nabble.com/Zend-Dom-out-of-memory-td656962.html

http://framework.zend.com/manual/en/zend.dom.query.html

The arbitrary attributes query may cause some memory leak.

// leak about 10k to 30k for each of query
$domDiv = $dom->query('div[class="someClass"]');

// no leak at all
$domDiv = $dom->query('div.someClass');

It took me about 2 hours to find this issue.