Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '(python,': 0.07; 'context': 0.07; 'detect': 0.07; 'suppose': 0.07; 'components,': 0.09; 'http': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'restart': 0.09; 'assume': 0.14; 'leaks': 0.16; 'losing': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'unnecessary.': 0.16; 'usable': 0.16; 'trying': 0.19; 'meant': 0.20; 'starts': 0.20; 'seems': 0.21; 'memory': 0.22; 'header:User-Agent:1': 0.23; 'bytes': 0.24; 'case.': 0.24; 'right.': 0.26; 'suggested': 0.26; 'header:X-Complaints-To:1': 0.27; 'chris': 0.29; 'waste': 0.30; 'easier': 0.31; 'usually': 0.31; 'are.': 0.31; 'consisting': 0.31; 'writes:': 0.31; 'languages': 0.32; 'but': 0.35; 'there': 0.35; 'really': 0.36; 'ram': 0.36; 'charset:us-ascii': 0.36; 'server': 0.38; 'checks': 0.38; 'to:addr:python-list': 0.38; 'reported': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'how': 0.40; 'even': 0.60; 'most': 0.60; 'browser': 0.61; 'times': 0.62; 'received:217': 0.63; 'developed': 0.63; 'such': 0.63; 'different': 0.65; 'request.': 0.70; 'analysis': 0.75; 'day': 0.76; 'attractive': 0.81; 'action.': 0.84; 'leak': 0.84; 'perspective.': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: dieter Subject: Re: Debugging memory leaks Date: Sun, 16 Jun 2013 08:18:38 +0200 References: <09917103-b35e-4728-8fea-bcb4ce2bd1af@googlegroups.com> <51ba82b5$0$29997$c3e8da3$5496439d@news.astraweb.com> <87y5abyig3.fsf@handshake.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gmane-NNTP-Posting-Host: pd9e0bdd8.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) Cancel-Lock: sha1:tekoGwbCYn7WILd6DErJh0/pOQU= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371363534 news.xs4all.nl 15939 [2001:888:2000:d::a6]:40526 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48414 Chris Angelico writes: > ... > Right. Everything needs to be scaled. Everything needs to be in > perspective. Losing 1 kilobit per day is indeed trivial; even losing > one kilobyte per day, which is what I assume you meant :), isn't > significant. But it's not usually per day, it's per leaking action. > Suppose your web browser leaks 1024 usable bytes of RAM every HTTP > request. Do you know how much that'll waste per day? CAN you know? What I suggested to the original poster was that *he* checks whether *his* server leaks a really significant amount of memory -- and starts to try a (difficult) memory leak analysis only in this case. If he can restart his server periodically, this may make the analysis unnecessary. I also reported that I have undertaken such an analysis several times and what helped me in these cases. I know - by experience - how difficult those analysis are. And there have been cases, where I failed despite much effort: the systems I work with are huge, consisting of thousands of components, developed by various independent groups, using different languages (Python, C, Java); each of those components may leak memory; most components are "foreign" to me. Surely, you understand that in such a context a server restart in the night of a week end (leading to a service disruption of a few seconds) seems an attractive alternative to trying to locate the leaks. Things would change drastically if the leak is big enough to force a restart every few hours. But big leaks are *much* easier to detect and locate than small leaks.