baxy77bax has asked for the wisdom of the Perl Monks concerning the following question:
well I have this odd problem with memory leak but i don't see where does the script go wrong. So I inherited some script that basically transforms data from some output given in rows to another output where this data is written in columns. And so after some heavy-duty transforming you finally and with an array like this:
so as you can notice i used Data dumper to get the output. Now the remainder of the program goes as follows:$VAR1 = [ [ undef, undef, undef, undef, undef, [ '10', '10', '10', '10', 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
and it works ok when i don't have the :my $msm = 1; foreach my $msmtable (@array1){ open (OUT,">","$ARGV[1].$msm.msm.dat") || die "$!"; for (my $x = 0;$x <$max[0];$x++){ foreach my $row (@{$array1[$msmtable]}){ print OUT "$array1[$msmtable][$row][$x],"; } print OUT "\n"; } $msm++; close OUT; }
line. But when this line is included memory consumption just goes sky-high and finally the system collapses. Now I don't believe that this could be due to printing, I mean, I never had this problem before. So what I'm asking is for suggestions where this could go wrong ?? can the actual data in the array have something to do with it ?? If yes why then the Data::Dumper does not show the same behavior ?? I need help with this !print OUT "$array1[$msmtable][$row][$x],";
Cheers
Baxy
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Memory leak while printing ?? Don't think so....
by ikegami (Patriarch) on Aug 01, 2011 at 09:50 UTC | |
by ikegami (Patriarch) on Aug 01, 2011 at 09:57 UTC | |
by baxy77bax (Deacon) on Aug 01, 2011 at 10:06 UTC | |
|
Re: Memory leak while printing ?? Don't think so....
by jethro (Monsignor) on Aug 01, 2011 at 10:12 UTC |