Christian Heimes <li...@cheimes.de> added the comment:

When I run your example, RSS jumps from 20 MB to about 1,600 MB. There is 
almost no increase when I run the look several more times.

>>> p.memory_info()
pmem(rss=19902464, vms=240513024, shared=10014720, text=2125824, lib=0, 
data=9887744, dirty=0)
>>> asyncio.run(main(2000))
<stdin>:2: DeprecationWarning: The explicit passing of coroutine objects to 
asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in 
Python 3.11.
>>> p.memory_info()
pmem(rss=1608568832, vms=1829105664, shared=10014720, text=2125824, lib=0, 
data=1598480384, dirty=0)
>>> asyncio.run(main(2000))
>>> p.memory_info()
pmem(rss=1608835072, vms=1829367808, shared=10014720, text=2125824, lib=0, 
data=1598742528, dirty=0)
>>> asyncio.run(main(2000))
>>> p.memory_info()
pmem(rss=1608601600, vms=1829367808, shared=10014720, text=2125824, lib=0, 
data=1598742528, dirty=0)


Why are you creating so many SSLContext objects any way? It's very inefficient 
and really not necessary. I recommend that you create one context in your 
application and reuse for all connection. You only ever need additional 
contexts for different configuration (protocol, verification, trust anchors, 
...).

----------
assignee: christian.heimes -> 

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40727>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to