Subject: | Circular reference in Net::DNS::Packet <-> Net::DNS::Header |
Hi.
Net::DNS::Packet holds reference to Net::DNS::Header
line 212 (header method) > $self->{header} ||= new Net::DNS::Header($self);
and passes self to it. Net::DNS::Header holds reference to parent Net::DNS::Packet object in "xbody", creating circular reference which result in memory leak.
Simply adding weaken (from Scalar::Util) in Net::DNS::Header constructor
Show quoted text
> weaken $self->{xbody};
works in my case.