in reply to Release memory in hash of hashes
You can
which will reduce it's reference count by one, and *potentially* free it's memory, provided there are no other references to the structure, or parts of it, that are still in scope.undef %hash;
If you are holding any other pointers to %hash or parts of it, you'll need to undef them too (provided they are still in scope but no longer useful).
Useful discussion here: Perl garbage collector and swap and there was a recent thread on memory de-allocation here : Memory reusability and the google book link to the internals discussion in Advanced Perl Programming.
Although, the beauty of Perl is that you shouldn't have to worry about these sort of things! HTH
Update: Added google book link
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Release memory in hash of hashes
by ikegami (Patriarch) on Aug 17, 2009 at 15:47 UTC | |
by BioLion (Curate) on Aug 17, 2009 at 16:26 UTC |