Note that this frees memory to the perl interpter, not to the OS. ie perl can reuse that memory when creating further data, but other processes can'tmy $a = []; $a->[$_] = $_ for 0..999; $#$a = 1; # frees up approx 16000 bytes undef @$a; # frees a further 4000 bytes undef $a; # frees a further 52 bytes
update: to clarify: just doing the undef $a on its own would free up all 20052 bytes too.
Dave.
In reply to Re^3: memory "release" with $#=-1
by dave_the_m
in thread memory "release" with $#=-1
by ISAI student
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |