Hi everyone,
My program has a problem look like memory leak (log: Exceeded soft
memory limit). I find it is the result of instance methods key() of
Model Class. Algorithm as below:
def post(self):
"""/queue_task/get_key
Get all entity key of ModelA
"""
entityList = []
cursor = self.request.get('cursor', '')
query = ModelA.all().all()
if cursor:
query.with_cursor(cursor)
queryResult = query.fetch(1000)
for entity in queryResult:
entityList.append(entity.key().__str__())
# save entityList into datastore
taskqueue.add(url='/queue_task/get_key',
params={'cursor': query.cursor()},
queue_name='task',
target='backendA')
The usage memory will increase (all task run in one backend instance)
and exceeded soft memory limit finally. If I replace entity.key() with
some variable or string, it is work successfully. What happens in this
code or key() of Model Class??
Thanks
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.