|Perl Monk, Perl Meditation|
Re^2: Postpone garbage collection during a child process run?by flexvault (Monsignor)
|on Oct 06, 2010 at 18:38 UTC||Need Help??|
Let me add some information to help the PerlMonks help me.
Why do I think it has something to do with garbage collection?
Since the use of the hash pointer did not cause a 'die', it must be still pointing at valid allocated memory. And when looking at the syslog entries, the pointer address at start of the subroutine and at the end of the routine is the same, as well as where it's pointing. However, after the return from the subroutine, the syslog entries show that the pointer address is the same, but it's contents (where it is pointing) is different, and that address points to the valid hash but without the changes made during the call to the subroutine. This looks like the hash was copied to a new location, and the old hash memory was placed on a free list, and not returned to the operating system.
I can only guess about this!
It seems, I was able to use the pointer before the copy completed, or some other type of race condition existed between garbage collection and my program. If garbage collection locked the hash, then the pointer wasn't updated until after I used it or when the subroutine returned ( since it looked like the subroutine was never called ).
If I am using the term 'garbage collection' incorrectly and a different term defines what I observed, please enlighten me.
"Well done is better than well said." - Benjamin Franklin