Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added 'Why is Django leaking memory?' to docs/faq.txt

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3158 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5bd6b322a946243c302b4c8d6264c38a74faa433 1 parent a8a133c
Adrian Holovaty authored June 20, 2006

Showing 1 changed file with 33 additions and 10 deletions. Show diff stats Hide diff stats

  1. 43  docs/faq.txt
43  docs/faq.txt
@@ -35,7 +35,7 @@ to early 1950s. To this day, he's considered one of the best guitarists of all t
35 35
 
36 36
 Listen to his music. You'll like it.
37 37
 
38  
-Django is pronounced **JANG**-oh. Rhymes with FANG-oh.
  38
+Django is pronounced **JANG**-oh. Rhymes with FANG-oh. The "D" is silent.
39 39
 
40 40
 .. _Django Reinhardt: http://en.wikipedia.org/wiki/Django_Reinhardt
41 41
 
@@ -43,8 +43,8 @@ Is Django stable?
43 43
 -----------------
44 44
 
45 45
 Yes. World Online has been using Django for more than two years. Sites built on
46  
-Django have weathered traffic spikes of over one million hits an hour and at
47  
-least one Slashdotting. Yes, it's quite stable.
  46
+Django have weathered traffic spikes of over one million hits an hour and a
  47
+number of Slashdottings. Yes, it's quite stable.
48 48
 
49 49
 Does Django scale?
50 50
 ------------------
@@ -277,7 +277,8 @@ Just run the ``ez_setup.py`` script in the Django distribution.
277 277
 What are Django's prerequisites?
278 278
 --------------------------------
279 279
 
280  
-Django requires Python_ 2.3 or later. No other Python libraries are required.
  280
+Django requires Python_ 2.3 or later. No other Python libraries are required
  281
+for basic Django usage.
281 282
 
282 283
 For a development environment -- if you just want to experiment with Django --
283 284
 you don't need to have a separate Web server installed; Django comes with its
@@ -285,8 +286,9 @@ own lightweight development server. For a production environment, we recommend
285 286
 `Apache 2`_ and mod_python_, although Django follows the WSGI_ spec, which
286 287
 means it can run on a variety of server platforms.
287 288
 
288  
-You'll also need a database engine. PostgreSQL_ is recommended, and MySQL_
289  
-and `SQLite 3`_ are supported.
  289
+If you want to use Django with a database, which is probably the case, you'll
  290
+also need a database engine. PostgreSQL_ is recommended, because we're
  291
+PostgreSQL fans, and MySQL_ and `SQLite 3`_ are also supported.
290 292
 
291 293
 .. _Python: http://www.python.org/
292 294
 .. _Apache 2: http://httpd.apache.org/
@@ -303,7 +305,7 @@ Not if you just want to play around and develop things on your local computer.
303 305
 Django comes with its own Web server, and things should Just Work.
304 306
 
305 307
 For production use, though, we recommend mod_python. The Django developers have
306  
-been running it on mod_python for more than two years, and it's quite stable.
  308
+been running it on mod_python for several years, and it's quite stable.
307 309
 
308 310
 However, if you don't want to use mod_python, you can use a different server,
309 311
 as long as that server has WSGI_ hooks. See the `server arrangements wiki page`_.
@@ -379,9 +381,11 @@ Do I have to use your model/database layer?
379 381
 -------------------------------------------
380 382
 
381 383
 Nope. Just like the template system, the model/database layer is decoupled from
382  
-the rest of the framework. The one exception is: If you use a different
383  
-database library, you won't get to use Django's automatically-generated admin
384  
-site. That app is coupled to the Django database layer.
  384
+the rest of the framework.
  385
+
  386
+The one exception is: If you use a different database library, you won't get to
  387
+use Django's automatically-generated admin site. That app is coupled to the
  388
+Django database layer.
385 389
 
386 390
 How do I use image and file fields?
387 391
 -----------------------------------
@@ -463,6 +467,25 @@ Yes. See `Integrating with a legacy database`_.
463 467
 
464 468
 .. _`Integrating with a legacy database`: http://www.djangoproject.com/documentation/legacy_databases/
465 469
 
  470
+Why is Django leaking memory?
  471
+-----------------------------
  472
+
  473
+Django isn't known to leak memory. If you find your Django processes are
  474
+allocating more and more memory, with no sign of releasing it, check to make
  475
+sure your ``DEBUG`` setting is set to ``True``. If ``DEBUG`` is ``True``, then
  476
+Django saves a copy of every SQL statement it has executed.
  477
+
  478
+(The queries are saved in ``django.db.connection.queries``. See
  479
+_`How can I see the raw SQL queries Django is running?`.)
  480
+
  481
+To fix the problem, set ``DEBUG`` to ``False``.
  482
+
  483
+If you need to clear the query list manually at any point in your functions,
  484
+just call ``reset_queries()``, like this::
  485
+
  486
+    from django import db
  487
+    db.reset_queries()
  488
+
466 489
 The admin site
467 490
 ==============
468 491
 

0 notes on commit 5bd6b32

Please sign in to comment.
Something went wrong with that request. Please try again.