1- Is there a way during a while (<IN>), to first initialize everything (all variables, arrays, subs, etc.) in a single command (just curious).
2- Is there a way during a process to track/monitor exactly what (variable, array, hash) gets how much memory allocated.
Thanks very much
UPDATE: given the amount of data, %seen eating memory.
#!/usr/bin/perl -w use strict; use Algorithm::Loops qw(NestedLoops); sub combo { #thanks Roy Johnson my $something = shift; my %seen; my $combos = NestedLoops([$something->[0],map {my $_hold = $_; sub {[grep {!$seen{join(':', sort @_, $_)}++} @{$something->[$_hol +d]}]}} 1..$#$something]); my $value = 0; my ($result, $someFct); while (my @result = $combos->()) { if (someSub(\@result) > $value) { $result = join (',', @result); $someFct = (someSub(\@result)); } else {();} } return $someFct,"\t",$result,"\n"; }
In reply to Memory monitoring by FFRANK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |