Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #48032

Re: Debugging memory leaks

References <09917103-b35e-4728-8fea-bcb4ce2bd1af@googlegroups.com> <mailman.3165.1371104977.3114.python-list@python.org> <slrnkrkacg.2u4.giorgos.tzampanakis@brilliance.eternal-september.org>
Subject Re: Debugging memory leaks
From Steve Simmons <square.steve@gmail.com>
Date 2013-06-13 22:45 +0100
Newsgroups comp.lang.python
Message-ID <mailman.3232.1371162031.3114.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Giorgos Tzampanakis <giorgos.tzampanakis@gmail.com> wrote:

>On 2013-06-13, dieter wrote:
>
>>> ...  Anyway, my real question is how to go about debugging memory
>leak
>>> problems in Python, particularly for a long running server process
>>> written with Twisted. I'm not sure how to use heapy or guppy, and
>>> objgraph doesn't tell me enough to locate the problem.
>>
>> Analysing memory leaks is really difficult: huge amounts of data is
>> involved and usually, it is almost impossible to determine which of
>the
>> mentioned objects are leaked and which are rightfully in use.  In
>> addition, long running Python processes usually have degrading memory
>> use - due to memory fragmentation. There is nothing you can do
>against
>> this.
>>
>> Therefore: if the leak seems to be small, it may be much more
>advicable
>> to restart your process periodically (during times where a restart
>does
>> not hurt much) rather than try to find (and fix) the leaks. Only when
>> the leak is large enough that it would force you to too frequent
>> restarts, a deeper analysis may be advicable (large leaks are easier
>to
>> locate as well).
>
>
>Am I the only one who thinks this is terrible advice?
>
>-- 
>Real (i.e. statistical) tennis and snooker player rankings and ratings:
>http://www.statsfair.com/ 
>-- 
>http://mail.python.org/mailman/listinfo/python-list

No you are not alone.  Ignoring a bug is only sensible if you absolutely understand what is going wrong - and by the time you understand the problem that well, you probably have enough understanding to fix it.  If tools are available (as the OP knows), then learn them and use them to find/fix the bug. 
Steve S

Sent from a Galaxy far far away

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Debugging memory leaks writeson <doug.farrell@gmail.com> - 2013-06-12 18:24 -0700
  Re: Debugging memory leaks dieter <dieter@handshake.de> - 2013-06-13 08:29 +0200
    Re: Debugging memory leaks Giorgos Tzampanakis <giorgos.tzampanakis@gmail.com> - 2013-06-13 20:15 +0000
      Re: Debugging memory leaks Steve Simmons <square.steve@gmail.com> - 2013-06-13 22:45 +0100
      Re: Debugging memory leaks Chris Angelico <rosuav@gmail.com> - 2013-06-14 08:36 +1000
      Re: Debugging memory leaks Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-14 02:40 +0000
        Re: Debugging memory leaks Chris Angelico <rosuav@gmail.com> - 2013-06-14 19:30 +1000
        Re: Debugging memory leaks Giorgos Tzampanakis <giorgos.tzampanakis@gmail.com> - 2013-06-14 22:57 +0000
          Re: Debugging memory leaks Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-15 01:39 +0000
        Re: Debugging memory leaks dieter <dieter@handshake.de> - 2013-06-15 08:52 +0200
        Re: Debugging memory leaks Chris Angelico <rosuav@gmail.com> - 2013-06-15 17:21 +1000
        Re: Debugging memory leaks dieter <dieter@handshake.de> - 2013-06-16 08:18 +0200
      Re: Debugging memory leaks rusi <rustompmody@gmail.com> - 2013-06-14 06:53 -0700
        Re: Debugging memory leaks Chris Angelico <rosuav@gmail.com> - 2013-06-15 10:11 +1000
        Re: Debugging memory leaks Ben Finney <ben+python@benfinney.id.au> - 2013-06-15 10:16 +1000
          Re: Debugging memory leaks rusi <rustompmody@gmail.com> - 2013-06-14 20:16 -0700
            Re: Debugging memory leaks Ben Finney <ben+python@benfinney.id.au> - 2013-06-15 21:23 +1000
              Re: Debugging memory leaks rusi <rustompmody@gmail.com> - 2013-06-15 04:35 -0700
                Re: Debugging memory leaks Chris Angelico <rosuav@gmail.com> - 2013-06-15 21:54 +1000
  Re: Debugging memory leaks writeson <doug.farrell@gmail.com> - 2013-06-13 11:07 -0700
    Re: Debugging memory leaks Dave Angel <davea@davea.name> - 2013-06-13 14:44 -0400
  Re: Debugging memory leaks rusi <rustompmody@gmail.com> - 2013-06-14 05:36 -0700
  Re: Debugging memory leaks "Frank Millman" <frank@chagford.com> - 2013-06-21 08:50 +0200

csiph-web