[pve-devel] memory leak in PVE/QMPClient.pm
Stefan Priebe - Profihost AG
s.priebe at profihost.ag
Mon Oct 29 10:52:18 CET 2012
Am 29.10.2012 10:49, schrieb Dietmar Maurer:
> Instead, the following works (without using weaken):
>
> sub DESTROY {
> my ($self) = @_;
>
> # delete self referenced from mux
> $self->{mux}->{_object} = undef;
> }
>
> What do you think?
This can't work. Are you sure that you checked that perl destroys the
objects when going out of scope? I can't believe that. You won't see a
memory leak at the end as perl destroys then ALL objects but it does not
when going out of scope.
Just add a warn to the DESTROY subroutine and check your log. Perl
should call DESTROY on the object in each loop run of pvestatd. But with
your suggestion it does only at the end when killing the daemon.
Greets,
Stefan
More information about the pve-devel
mailing list