in reply to does splice'ing an array of hashes free memory?

People are answering about the size of the array, but you seem to be asking the hashes.

Or will the hashrefs be orphaned?

A variable that becomes orphaned (i.e. whose refcount becomes zero) is freed automatically.

Splicing one of the hash references from the array frees the reference, which reduce the refcount on the hash, which frees the hash.

  • Comment on Re: does splice'ing an array of hashes free memory?

Replies are listed 'Best First'.
Re^2: does splice'ing an array of hashes free memory?
by lagle (Novice) on Nov 01, 2010 at 16:42 UTC

    thank you! and this seems to be correct because perl only occupies up to 40 MiB while executing, even though the file it iterates is well above that (appr. 1.5 GiB).