Subject: | WWW::Scripter with Javascript plugin "leaks" memory |
Date: | Mon, 21 Nov 2011 15:13:48 -0800 |
To: | bug-WWW-Scripter-Plugin-JavaScript [...] rt.cpan.org |
From: | Stas Bekman <stas [...] stason.org> |
Hi Father,
It looks like JS engine doesn't free up the memory it used, e.g. a
simple script below adds 30-50MB each run, even though no history is
saved (at least according to the docs). Memory leaking has been observed
in top(1).
#!/usr/bin/perl --
use strict;
use warnings;
use WWW::Mechanize;
use WWW::Scripter;
my $mech = WWW::Scripter->new(max_docs => 1, max_history => 1);
$mech->use_plugin('JavaScript');
warn "engine started\n";
for (1..10) {
warn "run $_\n";
$mech->get('http://yahoo.com');
$mech->clear_history;
}
turning JS off fixes that, but defeats the purpose ;)
I'm using all the latest versions:
WWW-Scripter-Plugin-JavaScript-0.007
WWW-Scripter-0.024
This is perl 5, version 12, subversion 4 (v5.12.4) built for
i686-linux-gnu-thread-multi-64int
(with 45 registered patches, see perl -V for more detail)
Linux 3.0.0-12-generic-pae #20-Ubuntu SMP Fri Oct 7 16:37:17 UTC 2011
i686 i686 i386 GNU/Linux
Thanks
--
Show quoted text
________________________________________________
Stas Bekman http://stasosphere.com
http://stason.org http://chestofbooks.com
http://vitalitylink.com http://healingcloud.com