in reply to Re: freeing hashes on Linux
in thread freeing hashes on Linux

Hi Abigail! How about clearing all key/value pairs with:
%myhash = ();
How does this work internally?

Thanks, Michele.

Replies are listed 'Best First'.
Re: Re: Re: freeing hashes on Linux
by Elian (Parson) on May 22, 2003 at 16:32 UTC
    It works the same way. The killer is freeing up all the bucket entries, and when you undef the hash they get freed just the same as when the hash goes out of scope. There's rather a lot of small memory malloc'ing going on (with corresponding extra overhead in memory footprint that's generally unaccounted for) and when those get freed it triggers some pathological behaviour in some versions of glibc's memory system.