Opened 17 years ago

Closed 17 years ago

Last modified 11 years ago

#6734 closed (fixed)

Ceiling limit to connection.queries

Reported by: miohtama Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Keywords: memory leak, sql, connection, standalone
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If you run Django in standalone mode, debugging enabled, all SQL queries get logged. Eventually in long running processes this will exhaust the process memory. This is "known feature" and the current solution is to have FAQ about the issue. When something leaks memory, people might not look FAQ as the first resolution: http://blog.redinnovation.com/2008/03/07/debugging-django-memory-leak-with-trackrefs-and-guppy/

This all could be solved by simply making connection.queries working as FIFO queue and store max. 100 queries. No more "memory leaks", ever.

Change History (2)

comment:1 by Karen Tracey <kmtracey@…>, 17 years ago

Resolution: duplicate
Status: newclosed

Capping connection.queries was proposed and rejected in #3711. Looks like that one is still open for getting a note about the behavior into the official docs.

comment:2 by Aymeric Augustin <aymeric.augustin@…>, 11 years ago

Resolution: duplicatefixed

In cfcca7ccce3dc527d16757ff6dc978e50c4a2e61:

Fixed #3711, #6734, #12581 -- Bounded connection.queries.

Prevented unlimited memory consumption when running background tasks
with DEBUG=True.

Thanks Rob, Alex, Baptiste, and others.

Note: See TracTickets for help on using tickets.
Back to Top