in reply to Re^2: Release memory in hash of hashes
in thread Release memory in hash of hashes

Then assuming nothing else is referencing parts of the data structure held on to by $word_index_ref, all you need do is:

$word_index_ref = undef;

at which point perl will release all the memory allocated to $word_index_ref back to its heap where the memory will be available for reuse. However, do not expect to see the memory footprint for the running Perl application reduce at that point because perl typically does not hand the freed memory back to the OS.


True laziness is hard work