in reply to Garbage Collection on Hash delete

Perl will reclaim memory for later use regardless of which way you dereference the data structures.

If you are looking to see the memory usage drop, you may be disappointed to find that Perl does not always release memory back to the system. It does this on the assumption that you may use the memory again later.

In terms of the 'recommended' approach, it is really your preference, although I would strongly suggest you avoid the "delete each key" approach, as it is not very efficient."

Try out the suggestions made by other people, and see which one you feel comfortable with. Stick with it for a while. Experiment.

Replies are listed 'Best First'.
Re: Re: Garbage Collection on Hash delete
by netoli (Initiate) on Jan 12, 2003 at 17:56 UTC
    Thanks all for the discussion.
    I checked it out. If you just assign an empty list it will release the memory.
    netoli