Forums

RAM exceeded. Process Killed

Guys, please help my figuring out what's happening here. I received something like 15 emails in a row saying some process has been killed due to RAM memory issues. How do I figure out which process we are talking about?

The email should say which process it is in the message body -- it should be something like this:

One or more of your processes have exceeded the RAM limit (currently 3GB), and have been killed. They were:

...and then a bullet-pointed list of the processes that were killed.

Is says "uWSGI worker 2". This doesn't help. One thing that comes to my mind is that I tried to print several json files in a log file using logging, before strong them in the database. The jsons were huge. Otherwise I don't have any idea.

"uWSGI worker" mean your web app. You can check your access log to see what request was processed at that time.

Based on my access log I simply did a series of basic GET and PUT request. So I don't know how to figure out the problem. It's a pretty huge problem since I'm almost done with my Android App and I need to understand whether I have RAM issues here for my REST API.

You can inspect the memory usage of your workers. If you import uwsgi in your web app, then uwsgi.mem() has memory information. The number that you are interested in is uwsgi.mem[0] that is the number of bytes that is resident - which is also what causes the process to be killed if it is over 3G. If you log the memory use in you code at different points (prints to stderr will appear in your error log), then you can identify the code that is increasing the memory use and possibly work out why and what you can do about it.