in reply to Re: Memory management with long running scripts
in thread Memory management with long running scripts
I see that $self and the {event} are technically a circular reference, but since I only create one instance of Stuff, it should not be a source of ongoing leaks. Is there something else I'm missing under the covers of Event?package Stuff; use strict; use Event; sub new { my $class = shift; my $self = {}; $self->{args} = [@_]; bless $self, $class; $self->{event} = Event->timer( interval => 1, cb => [$self, "read"], ); return $self; } sub read { my $self = shift; my $e = shift; # do work that uses values from $self }
|
|---|