True, to me this has been very problematic, and recently I've found
out.
[ndi-cpan@bumppo.net - Tue Aug 27 18:03:14 2002]:
Show quoted text> I've got a handy bulkfilter plugin, but with this leak still in
play,
Show quoted text> anyone filtering mail in the quantities for which the plugin was
> designed will probably run out of memory. Here's a pair of mutually
> exclusive patches to rectify the situation.
>
> First, a good-but-incompatible "leak_memory" constructor argument.
> This
> option enables storage of $self on demand, and disables it by
default:
Show quoted text>
>
> 142,149d141
> < The C<leak_memory> option, if set to a true value, provides
> < access to $self stored in $object->{obj}. This creates a
> < circular reference and prevents Mail::Audit objects from
> < freeing their memory until the entire program exits, which
> < can incapacitate a machine processing large quantities of
> < mail within a single perl invocation. Some people like it
> < anyway.
> <
> 191,192c183
> < # access to $self, causes Mail::Audit objects to leak
> < $self->{obj} = $self if ($opts{'leak_memory'});
> ---
> > $self->{obj} = $self; # backwards-compatibility for everyone
who
Show quoted text> desperately needed access to $self
>
>
> Alternatively, here's a bad but compatible "no_leaks" constructor
> argument:
>
> 117,124d116
> < Unless the C<no_leaks> option is set to a true value, Mail::Audit
> < objects will store $self in $object->{obj}. This incidentally
> < hides Mail::Audit objects from garbage collection, preventing
> < them from freeing their memory until perl exits. If you're
> < processing large quantities of mail from within a single perl
> < invocation, and your scripts are bringing the OS to its knees
> < with VM thrash, you probably forgot to set C<no_leaks>.
> <
> 191,192c183
> < # backwards-compatibility for everyone who desperately
needed
Show quoted text> access to $self
> < $self->{obj} = $self unless ($opts{'no_leaks'});
> ---
> > $self->{obj} = $self; # backwards-compatibility for everyone
who
Show quoted text> desperately needed access to $self
>
> I hope one of these is satisfactory, especially the first one.
>
> -nat