Memory leak when using request.state #1748
-
Hi, Originally an issue I reported in fastapi, it seems that the following server definition will cause memory usage to grow on every request: from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route
from starlette.requests import Request
async def homepage(request: Request):
request.state.test = [x for x in range(999999)]
return JSONResponse({'hello': 'world'})
app = Starlette(routes=[
Route('/', homepage),
]) The array set as the I created a repo to demonstrate the issue here. Figured i'll report, so at least if someones getting a memory leak, this can help in possibly finding the cause. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Oh, it seems that #1749 has been opened for this. |
Beta Was this translation helpful? Give feedback.
Oh, it seems that #1749 has been opened for this.