Open GoogleCodeExporter opened 9 years ago
Ok, done.
I replace all the create_function of the code (and fix other problems:
http://code.google.com/p/ganon/issues/detail?id=21 )
This version parse data in loops of more than 100k iterations without problems.
The file can be downloaded also from:
http://trucomania.org/inaki/nml_ganon_rev72_2.rar
Regards!
Original comment by Radika...@gmail.com
on 20 Sep 2012 at 12:04
Attachments:
Hi again (Im talking alone :)
My version nml_ganon_2 still have memory leaks in some pages... :(
I think is for a circular reference of the root node.
For example, www.amazon.es
So... I re-check the class constructors and destructors, and modify the
destruction
of the nodes, starting with the root node.
Now, all works fine.
I added too a new version of select which fires an exception if the select
returns a null.
You have the file also in:
http://trucomania.org/inaki/nml_ganon_rev72_3.zip
Original comment by Radika...@gmail.com
on 22 Sep 2012 at 4:47
Attachments:
Thanks for the modification. I'm using it now as well. I recommend the author
review this and commit.
Original comment by sjwood...@gmail.com
on 18 Oct 2012 at 1:40
Thanks for your report and hard work! I apologize for responding this late.
This is indeed caused by the circular reference with the root/child nodes. Your
fix works in your example, but will not work in combination with
str_get_dom/file_get_dom. I haven't found a solution yet, so the best bet would
probably be to manually call $test_html->root->clear() after you're done.
Perhaps I should write a wiki page about that.
I did get rid of the create_function structures in the new version :)
Original comment by niels....@gmail.com
on 19 Oct 2012 at 5:38
"so the best bet would probably be to manually call $test_html->root->clear()
after you're done"
Hummm is the first thing I did, and dont works... dont free memory even you
call clear(), unset and many other things I could try :) (I was desperated!)
All the nodes remains in memory even you call clear()
One of my scripts runs about 900K iterations each day, and each day, the
scripts ends my server because lack of memory.
Your method to free all the nodes... I dont understand it, so I wrote a new,
take a look (it works)
Took me days of debugging, but I learned a lot of php :)
Finally, I dont use ganon anymore, because the lack of speed, but is a great
product.
Original comment by Radika...@gmail.com
on 19 Oct 2012 at 6:06
I tried the nml_ganon.php, but it fails with this code while the original
ganon.php works fine:
$mail->setOuterText(
'<script type="text/javascript">'
.'document.write(deobfuscate(\''.str_rot13(base64_encode($mail->html())).'\'));'
.'</script>'
.'<noscript>Please enable JavaScript to see the eMail address</noscript>'
);
It works with adding the <script> only, but when trying to add the <noscript>
part it fails.
Original comment by google.2...@spamgourmet.com
on 22 Apr 2013 at 5:38
The problem with the memory leaks stems from the fact that HTML_Parser creates
a node tree that does not get destroyed in the destructor and so both the tree
and the parser remain.
Attached is a patch that adds a destructor to HTML_Parser and uses a wrapper
class that will call this destructor.
Second attachment is an example script. Restoring old behaviour is easy. You
will clearly see the memory usage explode.
Original comment by leonard...@gmail.com
on 11 Sep 2014 at 3:06
Attachments:
Hi Everyone,
I want to use this library. Can anyone please tell me that Is this memory
problem fixed and code is committed?
Also, Is it works better than other like PhpSimpleDom?
Thanks
Original comment by sirs...@gmail.com
on 23 Feb 2015 at 8:08
Original issue reported on code.google.com by
Radika...@gmail.com
on 20 Sep 2012 at 9:42Attachments: