I have an observation about memory leak:
- If we try to POST files to Django view(I use DRF's APIView), Django will not release memory even a response has been made. The memory will keep rising if you keep uploading files even if you do nothing in views.py. (I have tried uploading 100 files concurrently calling the same API). I know that if an uploaded file is smaller than 2.5 megabytes, Django will hold the entire contents of the upload in memory. So I am wondering this could be an issue for a possible memory leak because it will never release the memory.
PS: Even if I set FILE_UPLOAD_MAX_MEMORY_SIZE=0, which means use disk to store the files instead of using memory, I can still see a memory rise at the background.
I am using:
- Python3.6/Django2.1, Gunicorn
- DEBUG = False
Does anyone know how to solve this issue ? Thanks a lot.