-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
asyncioexternal library/application issuesa separate library / application that's not SQLAlchemy has a problem (dependent or dependee)a separate library / application that's not SQLAlchemy has a problem (dependent or dependee)memoryissues related to memory useissues related to memory use
Description
Describe the bug
The code below consumes memory at the rate about 200 MB/s. The similar code calling asyncpg directly doesn't have the issue and demonstrates that asyncpg itself seems not to be affected.
To Reproduce
The full sample in a container: https://github.com/roman-g/sqlalchemy-memory-leak
import sqlalchemy.ext.asyncio as sa_async
import asyncpg
import asyncio
async def sa_main():
engine = sa_async.create_async_engine('postgresql+asyncpg://postgres:some_secret@postgresql:5432/postgres')
while True:
async with engine.connect():
pass
async def asyncpg_main():
connection = await asyncpg.connect('postgresql://postgres:some_secret@postgresql:5432/postgres')
while True:
async with connection.transaction():
pass
asyncio.run(sa_main())
### Error
No errors
### Versions
- OS: Linux
- Python: 3.11
- SQLAlchemy: 1.4.43
- Database: Postgres 14.1
- DBAPI (eg: psycopg, cx_oracle, mysqlclient): asyncpg
### Additional context
_No response_
Metadata
Metadata
Assignees
Labels
asyncioexternal library/application issuesa separate library / application that's not SQLAlchemy has a problem (dependent or dependee)a separate library / application that's not SQLAlchemy has a problem (dependent or dependee)memoryissues related to memory useissues related to memory use