Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the "soft private memory limit" in GAE?

Tags:

A user of my application attempted to send a file as an email attachment using my application. However, doing so raised the following exception which I'm having trouble deciphering

Exceeded soft private memory limit with 192.023 MB after servicing  2762 requests total  While handling this request, the process that handled this request was found to be using too much memory and was terminated. This is likely to cause a new process to be used for the next request to your application.  If you see this message frequently, you may have a memory leak in  your application. 

What is the "soft private memory limit" and what was likely to bring about this exception?

like image 850
user714852 Avatar asked Feb 17 '12 16:02

user714852


2 Answers

The "soft private memory limit" is the memory limit at which App Engine will stop an instance from receiving any more requests, wait for any outstanding requests, and terminate the instance. Think of it as a graceful shutdown when you're using too much memory.

Hitting the soft limit once in a while is ok since all your requests finish as they should. However, every time this happens, your next request may start up a new instance which may have a latency impact.

like image 186
Anand Mistry Avatar answered Oct 23 '22 17:10

Anand Mistry


I assume you are using the lowest-class frontend or backend instance. (F1 or B1 class) Both have 128 MB memory quota, so your app most likely went over this quota limit. However, this quota appears to be not strictly enforced and Google have some leniency in this (thus the term soft limit), I had several F1 app instances consuming ~200MB of memory for minutes before being terminated by the App Engine.

Try increasing your instance class to the next higher-level class (F2 or B2) that have 256MB memory quota and see if the error re-occurs. Also, do some investigation whether the error is reproducible every time you send e-mail with attachments. Because it's possible that what you are seeing is the symptom but not the cause, and the part of your app that consumes lots of memory lies somewhere else.

like image 24
Ibrahim Arief Avatar answered Oct 23 '22 17:10

Ibrahim Arief