in reply to undefining hashes to free memory

Perl may return memory to the OS by calling free() internally, but the OS may not be able to mark the memory really as free. Memory is usually organized in a linear heap. Suppose you allocate a big chunk of memory, and then a very small chunk of memory. Now the big chunk is freed, but the small chunk (which is allocated after the big one) is not. Memory can't be compacted by moving chunks around (think of pointers), so the consequence is that you have a big chunk of unused memory. Consecutive mallocs would use part of the big chunk, but you stay with a maximum peak.