Closed hoang-innomize closed 2 weeks ago
Do you get the same problem when you run your container locally?
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
This issue is a: (mark with an x)
Issue description
I am deploying a Flask app on Azure Container App consumption mode using 3 vCPUs and 6 GB RAM. This is a long-running Flask API and to avoid complex in the design, we have some APIs that we will process requests in the background using multithreading. After receiving a request, we start a new thread and return response to the end user. We have noticed an issue that when the threads process the background job, the memory usage is increasing and it keep there without cleaning up.
Expected behavior
After finishing the background job, basically the memory should be free up and reduce the memory usage.
Actual behavior
Memory keeps raising without releasing after processing the job.
Additional context
Dockerfile to run the API
Sample code to start threads
Python packages
Flask==3.0.0 Flask-Caching==2.3.0 flask-restx==1.3.0 gunicorn==22.0.0