zend_mm_heap error with simple_html_dom

2019-05-23 01:00发布

I'm trying to parse an HTML file with simplehtmldom and I'm getting this error:

zend_mm_heap corrupted

after about 4 seconds of execution on a 8231 lines HTML file. Could this be a bug or just excessive memory usage?

2条回答
在下西门庆
2楼-- · 2019-05-23 01:13

I found it on the SF homepage of the simplehtmldom:

change the 4 lines of code in simple_html_dom.php (that works for me)

// clean up memory due to php5 circular references memory leak...
function clear()
{
    unset($this->dom);
    unset($this->nodes);
    unset($this->parent);
    unset($this->children);
}
查看更多
再贱就再见
3楼-- · 2019-05-23 01:23

There is a bug that affects most PHP5.2 and above, and can (albeit not always consistently) affect any application that works with large numbers of objects, particularly when the server is heavily loaded; but does leave a "zend_mm_heap corrupted" message in the apache logs.

One possible solution is to add the line: export USE_ZEND_ALLOC=0 to the apache envvars file

查看更多
登录 后发表回答