Skip to content

Memory leak with Python 3.11.2 #7252

@scotloach

Description

@scotloach

Describe the bug

I am seeing a memory leak with aiohttp using Python 3.11.2.

When I downgrade to Python 3.11.0, it does not leak.

This is a script that does a large number of client requests to a large number of different servers. The script leaks hundreds of MB over the course of a few hours. I haven't yet gotten this to a form that can be easily reproduced and shared, but I thought I would get this entered in case anyone else is seeing similar symptoms.

To Reproduce

The script I am running creates about 700 https client sessions to different servers. Each session does a simple GET request, which most succeed but some fail in various ways. The script sleeps for 5 seconds and then repeats this.

Expected behavior

This should not leak memory over time. And it doesn't with 3.11.0. (I don't currently have an easy way to run it with 3.11.1).

Logs/tracebacks

n/a

Python Version

Python 3.11.2

aiohttp Version

Name: aiohttp
Version: 3.8.4
Summary: Async http client/server framework (asyncio)
Home-page: https://github.com/aio-libs/aiohttp
Author: 
Author-email: 
License: Apache 2
Location: /usr/lib64/python3.11/site-packages
Requires: aiosignal, async-timeout, attrs, charset-normalizer, frozenlist, multidict, yarl

multidict Version

Name: multidict
Version: 6.0.4
Summary: multidict implementation
Home-page: https://github.com/aio-libs/multidict
Author: Andrew Svetlov
Author-email: [email protected]
License: Apache 2
Location: /usr/lib64/python3.11/site-packages
Requires: 
Required-by: aiohttp, yarl

yarl Version

Name: yarl
Version: 1.8.2
Summary: Yet another URL library
Home-page: https://github.com/aio-libs/yarl/
Author: Andrew Svetlov
Author-email: [email protected]
License: Apache 2
Location: /usr/local/lib64/python3.11/site-packages
Requires: idna, multidict
Required-by: aiohttp

OS

Fedora release 37 (Thirty Seven)

Related component

Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions