To clarify, you're displaying a list of 1000+ models on a single page,
yes?

My understanding is that the debug_toolbar analyzes each SQL query and
keeps each result in memory before rendering everything in the
template. I don't know how your query works, but let's take an extreme
case and say your request executes 1000+ queries. In addition to
keeping 1000 models in memory, the debug_toolbar now has to also
contain the query data for 1000 queries. If you have a small amount of
memory, this could eat it up pretty quick.

I don't think setting MaxRequestsPerChild = 1 would do anything to
cause a MemoryError. It should actually help, since if you're
restarting the process after just 1 request, any memory leaks won't
have time to build up.

-- Andrew

On Jun 25, 1:15 pm, Frédéric Hébert <fg.heb...@gmail.com> wrote:
> Hi there,
>
>  I'm facing with a curious problem.
>
>  I've an project which is hosted on three differents servers :
>
>  one (my local PC) :
> debian lenny /
> python 2.5.2 / django 1.0.2 final
> apache 2.2.9 / mod_python 3.3.1-7
>
>  the two others (production and validation server) :
> OpenSUSE 11.1 /
> python 2.6.2 / django 1.0.2 final
> apache 2.2.10 / mod_python 3.3.x-x
>
>  Two months ago, I've launched this project both on production server
> and validation server.
>  Neither validation server nor production server caused me any
> trouble.
>
> Today, to test something, I've installed debug_toolbar extension and
> set MaxRequestPerChild to 1 in Apache's conf file, both on my local
> dev PC and on the validation server.
>
> When I want to display two long list (1000+ items each) i get a
> MemoryError one time out of two. The remainder of project goes fine.
>
>  I've resetted MaxRequestPerChild to 10000 (default value on OpenSUSE)
> and commented out debug_toolbar's things in my settings, restart
> Apache. But error happened again on the validation server.
>
>  On my local PC, it works well, with debug_toolbar and MaxReq.. set or
> not.
>
> I've pasted the traceback  herehttp://dpaste.com/hold/59667/
>
>  AFAICS, an exception occurs when django tries to render a debug
> template
>
> Here is an exerpt of my vhost conf file on OpenSUSE :
>  DocumentRoot /srv/www/enseignements-dev.ehess.fr/ue
>
>     <Location "/">
>       SetHandler python-program
>       PythonHandler django.core.handlers.modpython
>       SetEnv DJANGO_SETTINGS_MODULE ue.settings_dev
>       PythonDebug On
>       PythonPath "['/srv/www/enseignements-dev.ehess.fr/', '/srv/www/
> enseignements-dev.ehess.fr/ue/'] + sys.path"
>     </Location>
>
> Many thanks in advance,
>
>  Frédéric
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to