in reply to How do I free memory allocated to an array

I'm not sure how quick perl's garbage collection is with this kind of thing - personally I'd set it to an empty array (ie, @foo=() ). Possibly treating it as an arrayref may get more direct results:
\@foo=[];
...or maybe not. Of course even freed memory is not necessarily not marked as allocated (if you see what I mean).