Re: Image::Magick memory leak question
From: William Herrera (posting.account_at_lynxview.com)
Date: 11/20/03
- Next message: Aqua: "Re: Protecting Source code of a perl script"
- Previous message: Matthew Braid: "Re: Comments: locking variables"
- In reply to: Stan Brown: "Re: Image::Magick memory leak question"
- Next in thread: Stan Brown: "Re: Image::Magick memory leak question"
- Reply: Stan Brown: "Re: Image::Magick memory leak question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 20 Nov 2003 05:27:33 GMT
On Wed, 19 Nov 2003 19:57:31 +0000 (UTC), Stan Brown <stanb@panix.com> wrote:
>
>BTW, adding @$image = ();, right before the undef $image; call seems to
>have drasticly lowered the ammount of memory that it's leaking.
>
>Does that make any sens at all? I would hhave thoughtthat the undef would
>have deleted all parts of the $image object. Am I wrong?
>
With some module objects, who knows? You are undefining a reference to the
object, which cetainly frees the object (the array) if there are no other
references to it. However, it may be that the object's code keeps some hidden
reference to instances of itself (circular?) which then preserves all the
elements in the array when you undefine it. When you instead set the array
contents to none, you dereference and destroy all the actual elements in the
array. So the amount of leak is limited to just the empty array object's memory
usage alone, probably a much smaller leak.. I hope this makes sense. In any
case, I suggest considering saving required states, exiting, and re-running
the script itself periodically, to keep any remaining leakiness under control.
--- Use the domain skylightview (dot) com for the reply address instead.
- Next message: Aqua: "Re: Protecting Source code of a perl script"
- Previous message: Matthew Braid: "Re: Comments: locking variables"
- In reply to: Stan Brown: "Re: Image::Magick memory leak question"
- Next in thread: Stan Brown: "Re: Image::Magick memory leak question"
- Reply: Stan Brown: "Re: Image::Magick memory leak question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|