From d05b241f648f54a7b881a669ad8a60808d614d43 Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Mon, 4 May 2026 11:59:27 +0500 Subject: [PATCH] Fix a code block in leaks.rst. (#7489) --- docs/topics/leaks.rst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/topics/leaks.rst b/docs/topics/leaks.rst index e61f33aed..ff05cd284 100644 --- a/docs/topics/leaks.rst +++ b/docs/topics/leaks.rst @@ -68,19 +68,21 @@ Response, Item, Spider and Selector objects. You can enter the telnet console and inspect how many objects (of the classes mentioned above) are currently alive using the ``prefs()`` function which is an -alias to the :func:`~scrapy.utils.trackref.print_live_refs` function:: +alias to the :func:`~scrapy.utils.trackref.print_live_refs` function: + +.. code-block:: bash telnet localhost 6023 - .. code-block:: pycon +.. code-block:: pycon - >>> prefs() - Live References + >>> prefs() + Live References - ExampleSpider 1 oldest: 15s ago - HtmlResponse 10 oldest: 1s ago - Selector 2 oldest: 0s ago - FormRequest 878 oldest: 7s ago + ExampleSpider 1 oldest: 15s ago + HtmlResponse 10 oldest: 1s ago + Selector 2 oldest: 0s ago + FormRequest 878 oldest: 7s ago As you can see, that report also shows the "age" of the oldest object in each class. If you're running multiple spiders per process chances are you can