Hi Alex, Please note, I am already using a try/catch block on MemoryError, and this does indeed resolve the problem.
I think at the very least, we should attempt to generate the text exception, and if it fails due to a particular circumstance, then it will just fall back to doing whatever it originally does. I agree that it won't always 100% work (although I'm yet to see it fail in my tests), but generating the text based exception has a fairly small footprint, so it should work the majority of the time. Cal On Tue, Dec 20, 2011 at 8:01 PM, Alex Gaynor <[email protected]> wrote: > > > On Tue, Dec 20, 2011 at 1:56 PM, Paul McMillan <[email protected]> wrote: > >> > Place a try/catch for MemoryError on the exception handler to send back >> a >> > simple exception traceback to the browser. >> >> Yes, this makes sense, as long as we are sure the memory error is >> raised by Django code, not user code. >> >> > Include a configuration settings option to limit the maximum payload it >> will >> > send back to the browser per variable (i.e. maybe 500kb per stack >> frame, or >> > 2kb per variable etc) >> >> I think we should select some reasonable limits for these, and >> hardcode them, rather than adding a setting. Users who are debugging >> the entire contents of multi-megabyte variable values on the html >> debug page are doing it wrong. >> >> -Paul >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django developers" 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-developers?hl=en. >> >> > Once you get a real memory error (i.e. one indicating you're out of > memory, not just some operation wouldn't work "aaaa" * sys.maxint for > example), doing *any* allocation might fail, so any limits you try to put > down won't work in all circumstances. > > Alex > > -- > "I disapprove of what you say, but I will defend to the death your right > to say it." -- Evelyn Beatrice Hall (summarizing Voltaire) > "The people's good is the highest law." -- Cicero > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" 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-developers?hl=en. > -- -- *Cal Leeming* Technical Director | www.simplicitymedialtd.co.uk Registered company number 7143564 Office: +44 (0)2476 980798 | Cell: +44 (0)7534 971120 -- You received this message because you are subscribed to the Google Groups "Django developers" 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-developers?hl=en.
