Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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.043 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'explicitly': 0.04; 'remaining': 0.07; 'garbage': 0.09; 'logic': 0.09; 'subject:None': 0.09; 'subject:python': 0.11; 'blocks': 0.16; 'did,': 0.16; "didn't,": 0.16; 'gc.collect()': 0.16; 'subject: \n ': 0.16; 'wrote:': 0.17; 'memory': 0.18; 'code.': 0.20; 'question.': 0.20; 'subject:release': 0.22; "haven't": 0.23; 'external': 0.24; "we'd": 0.24; 'tried': 0.25; 'least': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'leave': 0.26; 'thanks!': 0.26; 'am,': 0.27; 'order.': 0.27; 'possibly': 0.27; 'question': 0.27; 'run': 0.28; 'post': 0.28; 'probably': 0.29; 'on,': 0.30; 'point': 0.31; 'running': 0.32; 'allocated': 0.33; 'idle': 0.33; 'to:addr:python-list': 0.33; 'another': 0.33; 'minimum': 0.34; "won't": 0.35; 'tool': 0.36; 'but': 0.36; "didn't": 0.36; 'anything': 0.36; 'subject: (': 0.36; 'enough': 0.36; 'subject:: ': 0.38; 'fact': 0.38; 'object': 0.38; 'some': 0.38; 'things': 0.38; 'delete': 0.38; 'performance': 0.39; 'to:addr:python.org': 0.39; 'takes': 0.39; 'received:192': 0.39; 'called': 0.39; 'received:192.168': 0.40; 'help': 0.40; 'your': 0.60; "you've": 0.61; 'subject:, ': 0.61; 'more': 0.63; 'hours': 0.66; 'subject: ': 0.66; 'received:74.208': 0.71; 'footprint': 0.84; 'reduced.': 0.84; 'remarks': 0.84; 'replies.': 0.84; 'commenting': 0.91; 'forgotten': 0.91; 'subject:Set': 0.91; 'subject:del': 0.91 Date: Wed, 06 Mar 2013 08:25:34 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) References: <390f0dc5-5750-4849-9433-a19d90cc8566@googlegroups.com> <87zjyhhret.fsf@nautilus.nautilus> <18272cff-cfb0-4bd3-8f5d-3b4641ba828e@googlegroups.com> <78E1273CA6E76A43BB8830A194FF709B0B12EC1A@039-SN2MPN1-012.039d.mgd.msft.net> In-Reply-To: <78E1273CA6E76A43BB8830A194FF709B0B12EC1A@039-SN2MPN1-012.039d.mgd.msft.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:yMoV4VtpZA6BdYAs2h0+ro+prgt0jDyPccy8liFs0T7 cLU/VYeENjVvzNTgUoEjFVTjjIgqvZ/HBebR57D/3uSF/IHibf gu+ok5QmUDAZwfrOMxjaQe8a9fO8wrErFD2Z0tvUyTC8yJhrWA NAO7PfO6zWorT/oLis6wSigyOEGV/+02mleVEKjIqQZf/Lke5A Ij99JJlPQKFTMfnfTQn+I1UOEFD0El8SYTKFvOCVC0Evk+Upyq IO2eELjMmROgjGEjPqOpjmjSE63yMhNw+OuSpDt5hOohZdlZdC /x0Y26VaBdz126kuVAvAQbnVd4jgAQ2zHzZxByjwmfl/0UHVw= = 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362576355 news.xs4all.nl 6875 [2001:888:2000:d::a6]:49802 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40634 On 03/06/2013 07:31 AM, Wong Wah Meng-R32813 wrote: > Apologies as after I have left the group for a while I have forgotten how not to post a question on top of another question. Very sorry and appreciate your replies. > > I tried explicitly calling gc.collect() and didn't manage to see the memory footprint reduced. I probably haven't left the process idle long enough to see the internal garbage collection takes place but I will leave it idle for more than 8 hours and check again. Thanks! > You're top-posting, which makes things very confusing, since your contribution to the message is out of accepted order. Put your remarks after the part you're commenting on, and delete anything following your message, as it clearly didn't need your comments. Once you've called gc.collect(), there's no point in waiting 8 hours for it to run again. It either triggered the C runtime's logic or it didn't, and running it again won't help unless in the meantime you rearranged the remaining allocated blocks. Accept the fact that not all freeing of memory blocks can possibly make it through to the OS. If they did, we'd have a minimum object size of at least 4k on the Pentium, and larger on some other processors. We'd also have performance that would crawl. So an external tool can only give you a very approximate size for what's going on in your own code. -- DaveA