develooper Front page | perl.beginners | Postings from April 2010

free memory

Thread Next
From:
Patrick Dupre
Date:
April 13, 2010 08:25
Subject:
free memory
Message ID:
Pine.SOC.4.63.1004131620430.7078@unix0.york.ac.uk
Hello,

I have the a hash of hash of ... of array
(see below hwo I can list it) whose i wish to free the memory at one
point. Right now the desallocation is not clean, ie that evert time that
I reallocate the hash, the programme requires more and mor space and
finally swap the memory !
How can I free the mempry right. I already tried several trivial
thing without success:

Thank for your help.

foreach my $sig (sort keys %$trans) {
   foreach my $vt_u (sort keys %{$$trans {$sig}}) {
     foreach my $Nu (sort keys %{$$trans {$sig}{$vt_u}}) {
       foreach my $ku (sort keys %{$$trans {$sig}{$vt_u}{$Nu}}) {
         foreach my $vt_l (sort keys %{$$trans {$sig}{$vt_u}{$Nu}{$ku}}) {
 	  foreach my $Nl (sort keys %{$$trans {$sig}{$vt_u}{$Nu}{$ku}{$vt_l}}) {
 	    foreach my $kl (sort keys %{$$trans {$sig}{$vt_u}{$Nu}{$ku}{$vt_l}{$Nl}}) {
 	      print "$sig, $vt_u, $Nu, $ku, $vt_l, $Nl, $kl: ", $$trans {$sig}{$vt_u}{$Nu}{$ku}{$vt_l}{$Nl}{$kl} [0], " ", $$trans {$sig}{$vt_u}{$Nu}{$ku}{$vt_l}{$Nl}{$kl} [1], "\n" ;
 	      }
 	    }
 	  }
 	}
       }
     }
   }


-- 
---
==========================================================================
  Patrick DUPRÉ                      |   |
  Department of Chemistry            |   |    Phone: (44)-(0)-1904-434384
  The University of York             |   |    Fax:   (44)-(0)-1904-432516
  Heslington                         |   |
  York YO10 5DD  United Kingdom      |   |    email: pd520@york.ac.uk
==========================================================================
Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About