Opened 8 years ago

Closed 8 years ago

Last modified 16 months ago

#6734 closed (fixed)

Ceiling limit to connection.queries

Reported by: miohtama Owned by: nobody
Component: Database layer (models, ORM) Version: master
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: UI/UX:


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:

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 Changed 8 years ago by Karen Tracey <kmtracey@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

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 Changed 16 months ago by Aymeric Augustin <aymeric.augustin@…>

  • Resolution changed from duplicate to fixed

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