Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential memory leak in flask_restful.reqparse ??? #948

Open
pjain05 opened this issue Jul 23, 2022 · 1 comment
Open

Potential memory leak in flask_restful.reqparse ??? #948

pjain05 opened this issue Jul 23, 2022 · 1 comment

Comments

@pjain05
Copy link

pjain05 commented Jul 23, 2022

Hello Community,

I am facing memory leak issues for my app on production which is based on flask(with flask_restful) served on gunicorn in GKE cluster. The memory consumed by the gunicorn workers are increasing with the no of requests. Ideally, after serving the requests, it should come down to normal value but don't. So, for memory profiling I am using guppy3 module. In the profiling logs, I can see something related to flask_restful.reqparse.Arguments dictionary[as shown below].

Can someone please confirm if it is a memory leak in flask_resful package or it's a false positive type datapoint?

Index Count % Size % Cumulative % Kind (class / dict of class)

 0    996   0 65265112  25  65265112  25 bytearray
 1   1036   0 34200608  13  99465720  38 set
 2 1092298  53 30632428  12 130098148  49 int
 3 226672  11 22550200   9 152648348  58 str
 4  46241   2 22130112   8 174778460  66 types.FrameType
 5  66816   3 15079512   6 189857972  72 dict (no owner)
 6 123981   6  8656568   3 198514540  76 tuple
 _**7  32144   2  7457408   3 205971948  78 dict of flask_restful.reqparse.Argument**_
 8   6297   0  6502768   2 212474716  81 type
 9  27177   1  4953176   2 217427892  83 types.CodeType

Gunicorn configuration:

workers = 7
max_requests = 50000
worker_class = "gevent"

Python version = 3.9.13
flask = 1.1.4
werkzueg = 1.0.1
flask_restful = latest

@owenwu811
Copy link

Examine how you're using the reqparse module from flask_restful in your application. Make sure you're properly releasing resources and deallocating objects when they are no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants