in reply to Is this a Memory leak ?

One way to avoid the leak would be using weak references
# declare stuff package stuff here ... use WeakRef; sub new { my($class, $session) = @_ my $self = { }; bless($self, $class); weaken($self->{'session'} = $session); }
So when your instance goes out of scope it's refcount should reach 0 and be released.
HTH

broquaint