Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'doing,': 0.16; 'from:addr:vinay_sajip': 0.16; 'logger.': 0.16; 'message- id:@post.gmane.org': 0.16; 'sajip': 0.16; 'subject:creating': 0.16; 'thread.': 0.16; 'vinay': 0.16; 'writes:': 0.19; 'memory': 0.22; 'module,': 0.23; 'subject:?': 0.29; 'threads': 0.30; "can't": 0.32; 'represents': 0.32; 'header:X-Complaints-To:1': 0.32; 'to:addr:python-list': 0.33; "i've": 0.33; 'chris': 0.34; 'header:User-Agent:1': 0.35; 'module.': 0.35; 'using': 0.35; 'determine': 0.36; 'idea': 0.36; 'charset:us-ascii': 0.36; 'log': 0.36; 'running': 0.37; 'issue': 0.37; 'url:docs': 0.37; 'url:python': 0.38; 'received:org': 0.38; 'url:org': 0.38; 'run': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'perhaps': 0.39; 'from:addr:yahoo.co.uk': 0.39; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'your': 0.60; 'here:': 0.62; 'leak': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Vinay Sajip Subject: Re: Improper creating of logger instances or a Memory Leak? Date: Sun, 19 Jun 2011 14:29:53 +0000 (UTC) References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 82.152.15.113 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 17 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308493805 news.xs4all.nl 49180 [::ffff:82.94.164.166]:38595 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7961 foobar gmail.com> writes: > I've run across a memory leak in a long running process which I can't > determine if its my issue or if its the logger. As Chris Torek said, it's not a good idea to create a logger for each thread. A logger name represents a place in your application; typically, a module, or perhaps some part of a module. If you want to include information in the log to see what different threads are doing, do that using the information provided here: http://docs.python.org/howto/logging-cookbook.html#adding-contextual-information-to-your-logging-output Regards, Vinay Sajip