MagicStack / MagicStack/uvloop

Memory leak in uvloop and tornado

Open
#252 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted need more info
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 PYTHONASYNCIODEBUG in 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?
Снимок экрана от 2019-06-09 17-39-17

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.