Menu

#21 Problem with memory

v1.0_(example)
closed
None
1
2019-04-18
2013-03-26
No

Hi all, i'm being crazy with this problem:

Ram Memory Usage start : ".convert(memory_get_usage(true)); require_once('simple_html_dom.php'); $urls[]="http://www.google.it"; $urls[]="http://www.repubblica.it"; $urls[]="http://www.gazzetta.it"; foreach($urls as $url) { $dom = file_get_html($url); echo "
Ram Memory Usage after import : ".convert(memory_get_usage(true)); // do some stuff here $dom->clear(); echo "
Ram Memory Usage after clear : ".convert(memory_get_usage(true)); } echo "
Ram Memory Usage end : ".convert(memory_get_usage(true)); ?>

this is the output:

Ram Memory Usage start : 512 kb
Ram Memory Usage after import : 1.5 mb
Ram Memory Usage after clear : 1.5 mb
Ram Memory Usage after import : 14.25 mb
Ram Memory Usage after clear : 13.75 mb
Ram Memory Usage after import : 23 mb
Ram Memory Usage after clear : 23 mb
Ram Memory Usage end : 23 mb

As you can see, memory doesn't free after the clear() function!

I try unset($dom); too but nothing...

I've great problem with script more complex than this, where i obtain "maximum error exceed"...

Discussion

  • LogMANOriginal

    LogMANOriginal - 2019-04-18
    • status: open --> closed
    • assigned_to: LogMANOriginal
    • discussion: enabled --> disabled
     
  • LogMANOriginal

    LogMANOriginal - 2019-04-18

    Closing because this should be fixed in the latest version. Please don't hesitate to open a new ticket for further discussion.

     
Auth0 Logo