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


Groups > comp.lang.python > #67959

Re: script uses up all memory

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!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.036
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'subject:script': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'django': 0.11; 'dig': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'thanks.': 0.20; 'memory': 0.22; 'cc:addr:python.org': 0.22; "shouldn't": 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'larry': 0.31; 'subject:all': 0.32; 'call.': 0.33; 'fri,': 0.33; 'comment': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'problems': 0.38; 'solve': 0.60; 'most': 0.60; 'first': 0.61; 'worth': 0.66; 'mar': 0.68; 'victory': 0.84; '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=ThFX5lJWFnVPzGmQVJcfFiAR3PGmqimUcz0hPA/gh/Y=; b=O+plmfBFBMNiexL6g4X+9lea3IQF9soZqYyL8giFRAMvpfRz7RpIaHGWQjDjmXJj4O lYdrzEvOHIFBJI04OVpDlDIKswmi/3i1QHZmH0St4GzutJpcK/HySO1ZIZOeE/hztr1Y yBnQgYYbCbqqCFMsbEg22LtoKovQWG+C4MjKYkh2rflfA5Ffmaae49FWhh9uNSTL3aD+ fZt5S2QiLXtWcUtb3K+0hMVJHojxLDPW2tGlcTnGSIhGkhP5hfm1OF++pjhCWtGMFpQF Xpa6j2wC5iqb5DM9yd4yQ8kpy9QzSrbk+ZSjj2rqeKAufzh4zIR2q/PHMpnVCh36HWkM u/ZQ==
MIME-Version 1.0
X-Received by 10.68.247.6 with SMTP id ya6mr17322258pbc.45.1394144922349; Thu, 06 Mar 2014 14:28:42 -0800 (PST)
In-Reply-To <CACwCsY4LCg5Mw-fx_Og93ErJ_N14Vqw7TO2TrEnp3wAdY0POkg@mail.gmail.com>
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>
Date Fri, 7 Mar 2014 09:28:42 +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.7879.1394144925.18130.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1394144925 news.xs4all.nl 2915 [2001:888:2000:d::a6]:58682
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:67959

Show key headers only | View raw


On Fri, Mar 7, 2014 at 9:21 AM, Larry Martell <larry.martell@gmail.com> wrote:
> First I added del(self.tools) before the Django call. That did not
> stop the memory consumption. Then I added a call to gc.collect() after
> the del and that did solve it. gc.collect() returns 0 each time, so
> I'm going to declare victory and move on. No time to dig into the
> Django code. Thanks.

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.

ChrisA

Back to comp.lang.python | Previous | NextNext 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