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


Groups > comp.lang.python > #67961

Re: script uses up all memory

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.061
X-Spam-Evidence '*H*': 0.88; '*S*': 0.00; 'explicitly': 0.05; 'subject:script': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'thread': 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; "shouldn't": 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; '[1]': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'subject:all': 0.32; 'call.': 0.33; 'fri,': 0.33; 'comment': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'doing': 0.36; 'should': 0.36; 'problems': 0.38; 'called': 0.40; 'most': 0.60; 'break': 0.61; 'stand': 0.64; 'worth': 0.66; 'here': 0.66; 'mar': 0.68; 'australia,': 0.84; 'avoided.': 0.91; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=r4x9HQYe1dJtgg3Ix8NjLPGPeB8BTosc6eRPbxKgrPQ=; b=Phbh1Oy4jHjDs0yDyXkC08RxgUmYHESgBVyE7vJchYv8cREog5+YvhVLxZpTwP2mja D2xIsg7Xi4VndIeE6stmBqXWO6yJozcvvmV1CH+fNHrppCje3ducGr3MJUkgYa2k7mTz UcMapfecjX5fcZRWnsqCHUuYTnQG/spTkoqlU1rfYyue8rFweliOKKs+GzBtNBlTr/71 DQRxNs/Qia2AMSmAf7N2uwQkBNWXh8h7eanE/6c1zchbYBbduOkDp6Dmd7lD6zpZlvMW d047LNIV/rcW2EidNR/cZFUfPgTVa51ti/dCcx/T1dXDBp+TdSUJR0OlFCxMLSlQZgi8 wRFA==
MIME-Version 1.0
X-Received by 10.194.59.210 with SMTP id b18mr14021345wjr.60.1394145816414; Thu, 06 Mar 2014 14:43:36 -0800 (PST)
In-Reply-To <87ha7bq7ls.fsf@elektro.pacujo.net>
References <CACwCsY65gpn_Zx78wquE-rmrZu10pu9GYbzWd-Y3ypzHsMb2Yw@mail.gmail.com> <CACwCsY4nxs-4WmKboA9mOwrjQjXKXmaBPTuuq0GSmjzEpA3efQ@mail.gmail.com> <CAPTjJmr=1CW3BP23x2RTmnfxWppUNz_m_jHp=6aBTF0qj3YkVw@mail.gmail.com> <CACwCsY4LCg5Mw-fx_Og93ErJ_N14Vqw7TO2TrEnp3wAdY0POkg@mail.gmail.com> <mailman.7879.1394144925.18130.python-list@python.org> <87ha7bq7ls.fsf@elektro.pacujo.net>
Date Fri, 7 Mar 2014 09:43:36 +1100
Subject Re: script uses up all memory
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.7880.1394145824.18130.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1394145824 news.xs4all.nl 2933 [2001:888:2000:d::a6]:42379
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:67961

Show key headers only | View raw


On Fri, Mar 7, 2014 at 9:34 AM, Marko Rauhamaa <marko@pacujo.net> wrote:
> Chris Angelico <rosuav@gmail.com>:
>
>> Not all problems need to be solved perfectly :) But at very least, I
>> would put a comment against your collect() call explaining what
>> happens: that self.tools is involved in a refloop. Most Python code
>> shouldn't have to call gc.collect(), so it's worth explaining why you
>> are here.
>
> Refloops also are nothing to be avoided. Let GC do its job and forget
> about it.

I think this thread is proof that they are to be avoided. The GC
wasn't doing its job unless explicitly called on. The true solution is
to break the refloop; the quick fix is to call gc.collect(). I stand
by the recommendation to put an explanatory comment against the
collect call. [1]

ChrisA

[1] Here in Australia, that should be gc.reverse_charges().

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


Thread

Re: script uses up all memory Chris Angelico <rosuav@gmail.com> - 2014-03-07 09:28 +1100
  Re: script uses up all memory Marko Rauhamaa <marko@pacujo.net> - 2014-03-07 00:34 +0200
    Re: script uses up all memory Chris Angelico <rosuav@gmail.com> - 2014-03-07 09:43 +1100
      Re: script uses up all memory Marko Rauhamaa <marko@pacujo.net> - 2014-03-07 01:12 +0200
        Re: script uses up all memory Chris Angelico <rosuav@gmail.com> - 2014-03-07 10:31 +1100
          Re: script uses up all memory Marko Rauhamaa <marko@pacujo.net> - 2014-03-07 01:53 +0200
            Re: script uses up all memory Chris Angelico <rosuav@gmail.com> - 2014-03-07 11:11 +1100
              Re: script uses up all memory Marko Rauhamaa <marko@pacujo.net> - 2014-03-07 02:31 +0200

csiph-web