My App Engine-application is having problem with memory leakage. I log memory usage along the way to find the issue.
from google.appengine.api.runtime import memory_usage
memory_usage().current()
The function that exceeded "soft private memory limit of 128 MB" is within a deferred task. It should behave the same each time. I re-run it from the consoles task-queue (backend) and from the frontend via get-request. Both get the exception after the 6th log.
The result differs is a way I can't wrap my head around:
<Frontend-run>
1: 40.3515625
2: 50.3515625
3: 59.71875
4: 63.5234375
5: 72.49609375
6: 75.48046875
<Backend-run>
1: 98.83203125
2: 98.83203125
3: 98.83203125
4: 98.83203125
5: 98.83203125
6: 98.83203125
I have three issues with the result:
- One vs. two thirds of total memory-pool is allocated at the start
- Backend uses twice as much memory (running the same function)
- The backend memory usage doesn't increases with time like the frontend does.
Can anyone make sense of this for me?