However, my question is actually how can ARENA COUNTS show
69084 REF-Tie::RefHash::Weak
when all the adding all the scalar(keys %HASHS) of all the hashes using Tie::RefHash::Weak, scalar(keys %EACHHASH) added together is much much less than 69084.
That is why they call it "memory leak" :) The "arena" goes through internal perl structures to see which structures are allocated. As long as variable is accessible from the user code, it is "good" structure. The problem comes, when the structure is not accessible from user code. This structure is then "leaked". So, if you have a leak, then you won't be able to see leaked structures from your perl code. Of course in this case your count won't match the count of "arena".
| [reply] |
Other than cyclic references (which I don't think could exist in my code), do you know what could cause this to happen?
I would think that if the reference count is 0, that the objects would be deleted.
What approach should I use to find the problem?
| [reply] |
Other than cyclic references (which I don't think could exist in my code), do you know what could cause this to happen?
Well, circular references do not have to be direct. There are lots of subtle ways for creating them. That makes finding them very complex at times.
I don't know about any other reason for perl to keep unused objects around.
| [reply] |