in reply to Memory reusability
It depends upon the version and platform of Perl.
Under Windows, perl can and does release some memory back to the OS when it is done with it, as demonstrated below:
c:\test>p1 Name "Data::Dump::MAX_WIDTH" used only once: possible typo at C:\Perl6 +4\bin\p1.p [0] Perl> system qq[ tasklist /fi "pid eq $$"];; Image Name PID Session Name Session# Mem + Usage ========================= ======== ================ =========== ====== +====== perl.exe 5600 Console 1 9 +,972 K [0] Perl> $big = 'x' x 10e6;; [0] Perl> system qq[ tasklist /fi "pid eq $$"];; Image Name PID Session Name Session# Mem + Usage ========================= ======== ================ =========== ====== +====== perl.exe 5600 Console 1 19 +,764 K [0] Perl> undef $big;; [0] Perl> system qq[ tasklist /fi "pid eq $$"];; Image Name PID Session Name Session# Mem + Usage ========================= ======== ================ =========== ====== +====== perl.exe 5600 Console 1 9 +,976 K
And I've heard tell, but cannot verify that under some circumstances, Perl will do the same on some other platforms. YMMV.
But in the end, it is irrelevant, and your trainers should be taken to task for even mentioning it at your stage of learning.
|
|---|