in reply to Re: Re: Garbage Collection on Hash delete
in thread Garbage Collection on Hash delete

So long as you don't use excessive amounts of memory, it shouldn't be a problem. Any way you clear the hash, the memory will be returned to Perl's pool. Even though Perl doesn't give any of its pool back to the OS, it will recycle memory from the pool for later use in the script. So if you accumulate a lot of data in the hash, the Perl process will grow by (say) 1MB, and not shrink again even if you clear the hash. However, if you fill the hash again, the Perl process will not grow again - it will simply reuse the memory it had allocated before.

Makeshifts last the longest.

  • Comment on Re^3: Garbage Collection on Hash delete