MagicStack / MagicStack/uvloop
Memory leak in uvloop and tornado
Nobody has claimed this yet.
- Dominant language
- Cython
- Stars
- 11.9k
- Forks
- 616
- PR merge metrics
- No merged PRs in 30d
Description
- uvloop version: 0.11.1
- Python version: 3.6.4
- Platform: Ubuntu 16.04 x64
- Can you reproduce the bug with
PYTHONASYNCIODEBUGin env?: This no effect
I have a platform to which mobile devices will constantly connect via TCP, about 20k per instance. After a few hours of work, memory consumption rises to 2 GB. We use tornado 5.0.1 as TCP server and install uvloop for loop for asyncio. I conducted one experiment using tracemalloc, when the devices are disconnected and then the memory leak is again connected in this code line , the number of objects and the total expanding. Can you help find what these objects are and how to remove this leak?

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Tornado's tornado/platform/asyncio.py around line 148, then reproduce the long-running TCP connection scenario and inspect object growth with tracemalloc. Compare memory behavior as devices disconnect and reconnect; done means the leak is isolated with a reproducible test or clear diagnostic result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100