I\'m trying to use PHP Simple HTML Dom Parser to parse some information from some sites. Does not matter what and where. But it seems, that there is some HUGE memory problem
I believe you need to call clear()
on $main_html
From the docs...
Q: This script is leaking memory seriously... After it finished running, it's not cleaning up dom object properly from memory..
A: Due to PHP5 circular references memory leak, after creating DOM object, you must call $dom->clear()
to free memory if call file_get_dom()
more than once.
Example:
$html = file_get_html(...);
// do something...
$html->clear();
unset($html);