http://qs321.pair.com?node_id=1207941


in reply to Re: Memory utilization and hashes
in thread Memory utilization and hashes

I don't think delete shrinks the hash per se. Certain hash admin is performed to mark hash entries unused, etc. Some linked memory (references) may become free.

But the only way to shrink the hash is to make a new hash, and copy over the "trimmed" old hash, and then throw away the old hash.

You should be able to make a test case for this, showing the size of a hash does not shrink after deletes, and that total process memory doesn't shrink, but only grows. It is up to you and Perl to make efficient use of an ever growing pile of memory allocated by the OS.

-QM
--
Quantum Mechanics: The dreams stuff is made of