title: Gunicorn high memory usage by multiple identical processes?
body: <p>I am puzzled by the high percentage of memory usage by Gunicorn. The application I am running is a deep learning framework for automatic image recognition. </p>
  
  <p>The memory usage is constantly hovering around 67%, even after I increased the memory size from 1GB to 3GB. What is even puzzling is that the memory seems to be used by multiple identical Gunicorn Processes, as shown below. I have manually killed some high-ram-usage processes such as PID 2004 and 1860, but they constantly came back and the 67% of memory usage remained and sometimes got even higher. As a result, image reading tool such as cv2.imread constantly fails to deal with a large-sized image because of out of memory. </p>
  
  <blockquote>
    <p>$ ps aux --sort=-%mem </p>
  </blockquote>
  
  <pre><code>USER  PID  %CPU %MEM VSZ     RSS    TTY    STAT START   TIME COMMAND
  user  2004  5.6 39.0 2304052 1201968 ?     S    17:33   0:08 /home/user/anaconda3/envs/project/bin/python /home/user/anaconda3/envs/project/bin/gunicorn --workers 2 --bind unix:/home/user/project-master/project.sock -m 007 wsgi:app
  user  1860  2.5 38.6 2289024 1189396 ?     S    17:14   0:32 /home/user/anaconda3/envs/project/bin/python /home/user/anaconda3/envs/project/bin/gunicorn --workers 2 --bind unix:/home/user/project-master/project.sock -m 007 wsgi:app
  user  1694  0.0  0.5  43620 17416 ?        Ss   17:14   0:00 /home/user/anaconda3/envs/project/bin/python /home/user/anaconda3/envs/project/bin/gunicorn --workers 2 --bind unix:/home/user/project-master/project.sock -m 007 wsgi:app
  </code></pre>
  
  <p>I wonder whether it is normal to have such high ram usage for Gunicorn-served web application? If not, is there any way I can fix it? Thanks! </p>