I expect the memory usage of my application kernel instances (Python) will be relatively flat after the first launch period. Each request to my application is short-lived, and it seems that memory access should be released soon after that to use one request.
However, in practice this is not so. The following is a snapshot of the instance memory usage provided by the console. My application has relatively low traffic, so I usually only have one instance running. During the two-day period of the schedule, the graph of memory usage is constantly increasing. (Two blips where two instances were briefly launched.)
I regularly get memory errors, so I would like to prevent this constant increase in memory usage.
During snapshot:
- Memcache uses less than 1 MB
- Target lines are empty
- Low traffic (0.2 counts per second)
I would expect instance memory usage to fall in these circumstances, but this does not happen.
Since I use Python with its automatic garbage collection, I do not see how I could do this.
Is this the expected behavior of the application engine and is there anything I can do to fix it?

source share