python 2.7.3, django 1.4.2
Our app (a fairly simple tastypie API that runs some machine learning foo on
mongodb records) is deployed to heroku and is leaking memory at a pretty good
clip. Hitting heroku memory errors after about an hour or two, under
significant load.
Wandered through some various profiling options and eventually started to get
suspicious of tastypie. So I tried ripping that out. And then everything else,
until I finally got down to a django view that has nothing but this in it:
def stack(request):
gc.set_debug(gc.DEBUG_LEAK)
print "Uncollectable garbage", gc.garbage
return HttpResponse('hi')
And even that, after a couple reloads, dumps a huge mess, the beginning of
which is below. Looks like the whole heap.
Any idea what might be going on here or what my next steps are?
Thanks!
Dan
Uncollectable garbage [<cell at 0x102723c20: WSGIRequest object at
0x102003350>, (<cell at 0x102723c20: WSGIRequest object at 0x102003350>,),
<function _get_val at 0x102731500>, (<type 'str'>,), <cell at 0x102723c90:
tuple object at 0x102721a90>, <cell at 0x102723cc8: function object at
0x102731500>, (<class 'django.utils.functional.Promise'>,), <function __init__
at 0x1027315f0>, (<cell at 0x102723c90: tuple object at 0x102721a90>, <cell at
0x102723cc8: function object at 0x102731500>), <function __reduce__ at
0x102731668>, (<cell at 0x102723c90: tuple object at 0x102721a90>,), <function
__prepare_class__ at 0x1027316e0>, <classmethod object at 0x102723d00>, (<cell
at 0x102723cc8: function object at 0x102731500>,), <function __promise__ at
0x102731758>, <classmethod object at 0x102723d38>, (<cell at 0x102723cc8:
function object at 0x102731500>,), <function __unicode_cast at 0x1027317d0>,
(<cell at 0x102723cc8: function object at 0x102731500>,), <function __str_cast
at 0x102731848>, (<cell at 0x102723cc8: function object at 0x102731500>,),
<function __cmp__ at 0x1027318c0>, <function __mod__ at 0x102731938>, <function
__deepcopy__ at 0x1027319b0>, <class 'django.utils.functional.__proxy__'>,
{'upper': <function __wrapper__ at 0x102731aa0>, '__module__':
'django.utils.functional', '__getslice__': <function __wrapper__ at
0x102731b18>, 'lstrip': <function __wrapper__ at 0x102731b90>, '__str__':
<unbound method __proxy__.__str_cast>, '__reduce__': <function __reduce__ at
0x102731668>, 'rpartition': <function __wrapper__ at 0x102731c80>, 'replace':
<function __wrapper__ at 0x102731cf8>, '__rmul__': <function __wrapper__ at
0x102735050>, 'endswith': <function __wrapper__ at 0x102731de8>, 'splitlines':
<function __wrapper__ at 0x102731e60>, 'rfind': <function __wrapper__ at
0x102735ed8>, 'strip': <function __wrapper__ at 0x102731f50>, 'isdigit':
<function __wrapper__ at 0x102731d70>, '__rmod__': <function __wrapper__ at
0x1027350c8>, 'ljust': <function __wrapper__ at 0x102735140>,
'__prepare_class__': <classmethod object at 0x102723d00>, '__init__': <function
__init__ at 0x1027315f0>, 'index': <function __wrapper__ at 0x1027351b8>,
'__getnewargs__': <function __wrapper__ at 0x102735230>, 'isalnum': <function
__wrapper__ at 0x102735320>, '__contains__': <function __wrapper__ at 0
etc etc
--
You received this message because you are subscribed to the Google Groups
"Django users" 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/django-users?hl=en.