[Twisted-Python] Circular references in TLSMemoryBIOProtocol

L. Daniel Burr ldanielburr at me.com
Wed Jan 17 14:30:09 MST 2018


Hi Ilya,

On January 17, 2018 at 3:09:52 PM, Ilya Skriblovsky (ilyaskriblovsky at gmail.com) wrote:

[Trimmed for context]

So using weakrefs makes all protocol instances and instances of TLSMemoryBIOProtocol to be deleted right after a connection is closed. Less circular-dependent objects → less GC invocations → better performance. And I see much nicer RAM usage pattern in my app.

Is it possible to fix circular deps in some more clean way? Can this be solved at all while user's code is able to try to touch both sides of circular dep after connection is closed? Please advice


Personally, I don’t mind the weaker approach, but if you wanted to be completely explicit, I’d look at modifying the connectionLost method of both the protocol and the protocol wrapper to break circular references.

Thanks for consideration

Best regards,
    Ilya

Hope this helps,

Daniel
--
L. Daniel Burr
ldanielburr at me.com
(312) 656-8387


-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20180117/d4453f1e/attachment-0002.html>


More information about the Twisted-Python mailing list