On Mon Apr 13 10:07:25 2009, DMUEY wrote:
Show quoted text> I've not dived in deep enough to know why yet (and hence if it is
> addressable or not) but
> someone brought to my attention that the memory use increases as you
> parse() data. (even if
> you call eof())
>
> figured I'd pass it along :)
I can't replicate this - the memory usage stays roughly constant even in a spinning infinite loop of pseudo-random HTML input (see attached - 'jargon.html' is
http://www.eps.mcgill.ca/jargon/jargon.html).
use HTML::Strip;
open my $fh, 'jargon.html';
binmode $fh, ':utf8';
local $/;
my $data = <$fh>;
my $l = length($data);
my $hs = HTML::Strip->new();
while (1) {
my $start = int(rand($l));
my $offset = int(rand($l-$start));
my $clean_text = $hs->parse( substr($data, $start, $offset) );
$hs->eof;
}