[Catalyst] Storing $c leaks memory?

Christopher H. Laco claco at chrislaco.com
Thu Aug 23 14:50:13 GMT 2007


Tobias Kremer wrote:
> While hunting down some memory leaks in my application I found that it's
> generally a bad idea to store $c in a class as this never gets cleared up
> completely, is that correct?
> =


I'd wager circular reference issue. Take a look into ACCEPT_CONTEXT
controller.

In short, if you're going to store a copy of $c in your classes, weaken
them first using Scalar::Util::weaken

Of course, I could be full of it. :-)

-=3DChris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070823/76a5=
0068/signature-0001.pgp


More information about the Catalyst mailing list