Answer the question
In order to leave comments, you need to log in
Why does the parser script eat up all the RAM?
After an hour or two, even if put in one thread, it turns out like this:
I read that it seems that phpQuery devours memory like this. I think XPath to put.
Answer the question
In order to leave comments, you need to log in
phpQuery doesn't clean up memory after itself. You need to do this through phpQuery::unloadDocuments();
. Here is an example:
$pq = phpQuery::newDocument($html);
$projects =[];
foreach ($pq['.project-preview'] as $work) {
$pqwork = pq($work);
$projects[]['name'] = $pqwork['div']->eq(1)->text();
}
phpQuery::unloadDocuments();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question