Closed T-256 closed 1 year ago
by avoid using concurrent, there is much smaller memory leak (from 10MB to 18MB in my test):
import asyncio
async def leak():
async with httpx.AsyncClient(timeout=21) as client:
async with httpx_ws.aconnect_ws(
f"https://socketsbay.com/wss/v2/1/demo/",
client,
) as ws_client:
pass
async def main():
for _ in range(100):
await leak()
input("before")
asyncio.run(main())
input("after")
I got same result by replacing httpx_ws.aconnect_ws
with client.stream
.
perhaps it's httpx issue, I'll reopen there.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Expected behavior
No memory leak
Configuration
Additional context
In my run of above code memory bump from 10MB to 80MB