Hi,
Looks like Net::SNMP is leaking memory. I was testing my own module for
leaks an spotted this:
# Failed test at t/basic.t line 59.
# Cycle #1
# Mojo::SNMP A->{_pool} => %B
# %B->{1.2.3.5|v3||foo} => Net::SNMP C
# Net::SNMP C->{_pdu} => Net::SNMP::PDU D
# Net::SNMP::PDU D->{_callback} => &E
# closure &E, $this => $F
# $F => Net::SNMP C
The leak can be fixed by adding
Scalar::Util::weaken($this);
to line 2515 in Net/SNMP.pm, _perform_discovery(). I also suspect more
leaks, since I cannot see any use of Scalar::Util::weaken, but I see
many anon subs closing over $this.