Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Enlightened Ones,
I have a memory leak on the following code (run on ActiveState Perl and Windows 7). The problem seems to be with the call to HTML::Format. After the end of the loop there still seem to be variables containing text, etc. rather than it all getting properly scoped out (and hence the memory being returned). There is an earlier node addressing a similar problem (Memory Leak? i'm clueless.), but the solution mentioned there (insert a delete command for the input file) does not seem to work for me.
I had a look at the nodes discussing memory leaks in general, but frankly did not find them that useful since they all mention tools such as Devel::Peek, Devel::Cycle... - but I cannot find a description of these tools that I as a newbie can understand.
Any help would be appreciated!use warnings; use strict; use diagnostics; use HTML::FormatText; open INPUT, "< D:/htmladdresses.txt" or die "Problem: $!"; our @INPUT=<INPUT>; close INPUT; while (@INPUT) { my $input=shift(@INPUT); chomp $input; my $content=HTML::FormatText->format_file($input, leftmargin => 0, ri +ghtmargin => 50); # this is followed by some regular expression, all disabled now }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Memory Leak HTML::FormatText
by kcott (Archbishop) on Sep 14, 2013 at 02:03 UTC | |
by PerlNovice999 (Novice) on Sep 16, 2013 at 07:51 UTC | |
by Anonymous Monk on Sep 16, 2013 at 08:14 UTC | |
by PerlNovice999 (Novice) on Sep 16, 2013 at 09:23 UTC | |
by PerlNovice999 (Novice) on Sep 16, 2013 at 09:17 UTC | |
by Anonymous Monk on Sep 16, 2013 at 10:14 UTC | |
by PerlNovice999 (Novice) on Sep 18, 2013 at 12:25 UTC | |
by Anonymous Monk on Sep 18, 2013 at 13:27 UTC | |
| |
by PerlNovice999 (Novice) on Sep 16, 2013 at 09:07 UTC | |
by PerlNovice999 (Novice) on Sep 16, 2013 at 09:45 UTC | |
Re: Memory Leak HTML::FormatText
by CountZero (Bishop) on Sep 13, 2013 at 20:19 UTC |