django 1.4 memory issues

74 views
Skip to first unread message

Greg Donald

unread,
Jun 12, 2012, 10:59:08 AM6/12/12
to django...@googlegroups.com
Over the weekend I upgraded my project to Django 1.4. After the
upgrade my Apache/mod_wsgi setup began running out of memory. I
increased the memory capacity of my virtual servers, but that only
extended the time until they began to swap again. I found a blog
article that suggested setting Apache's MaxRequestsPerChild to
something other than 0. After setting it to 25, Apache seems to be
releasing memory again.

My question is, why did I have to do that? The only thing that
changed is my Django version from 1.3 -> 1.4. I have Debug=False in
settings.py, so I don't think I'm experiencing the SQL memory buildup
described on a couple of blogs. I do have some long running scripts
that use Django outside of Apache, so I implemented db.reset_queries()
in those, but it had no noticeable effect. They didn't appear to be
using any more memory than normal, but I figured it couldn't hurt.

So everything is running fine again, but something changed in Django
1.4 that causes my same project code to leak memory. I'd sure like to
figure it out.

Thanks.


--
Greg Donald

francescortiz

unread,
Jun 14, 2012, 3:40:09 AM6/14/12
to django...@googlegroups.com
You could create a bug report:

https://code.djangoproject.com/newticket

akaariai

unread,
Jun 14, 2012, 5:27:37 AM6/14/12
to Django users
I don't remember seeing memory leak issues reported for 1.3 -> 1.4
uprgades (which doesn't mean they do not exist).

It is very hard to say where the problem might be without further
details. I don't have much experience in memory leak debugging, but
this post for example looks promising:
http://www.lshift.net/blog/2008/11/14/tracing-python-memory-leaks

- Anssi


Reply all
Reply to author
Forward
0 new messages