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


Groups > comp.lang.python > #67898

Re: script uses up all memory

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.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.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'memory.': 0.07; 'subject:script': 0.09; 'yeah,': 0.09; 'cc:addr:python-list': 0.11; 'django': 0.11; 'random': 0.14; 'executed,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'output?': 0.16; 'reproduce': 0.16; 'script,': 0.16; 'wrote:': 0.18; '(not': 0.18; 'wed,': 0.18; 'thu,': 0.19; '>>>': 0.22; 'memory': 0.22; 'issue.': 0.22; 'cc:addr:python.org': 0.22; 'script.': 0.24; "shouldn't": 0.24; 'connected': 0.24; 'environment': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'script': 0.25; 'mention': 0.26; 'post': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'leave': 0.29; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'larry': 0.31; 'though.': 0.31; 'time;': 0.31; 'this.': 0.32; 'subject:all': 0.32; 'run': 0.32; 'running': 0.33; 'problem': 0.35; 'something': 0.35; 'no,': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'collecting': 0.36; "didn't": 0.36; "i'll": 0.36; 'should': 0.36; 'effort': 0.37; 'so,': 0.37; 'pm,': 0.38; 'rather': 0.38; 'little': 0.38; 'anything': 0.39; 'does': 0.39; 'though,': 0.39; 'days': 0.60; 'simply': 0.61; 'making': 0.63; 'holding': 0.65; 'talking': 0.65; 'here': 0.66; 'mar': 0.68; 'default': 0.69; 'forks': 0.84; 'messed': 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=EHeJudtNXDMhZwMT/C7ohU6vxt7D/l/wo6SYrGy2H0g=; b=etO0GZQbZtFNcwxvEgzXCKLcVCW1vcuYGtper11AlHS+T3INs0m/smZFYGk57r4xhA BmjlokG0I7z0cmxUBCNBviFkBH8HAlv1UYf5miUF2KRFuTRs55V2YIdFr7CzwA9fvgU2 Po+9APPwVTMPakweSCOWqYJlpbmNTD2VxezqvjsZSLOloID69TiucbW4C1MK582bzbRr B/JxpUKzxCMJbnXCdz9KaaAmvg6hpG9391lN6kyoi6uPHyVZrAhEDwmCyc8MUtgo/NXW V1qnD8a+sbEQExyrv64SZL1NjyY2I6DK1QWAQpAhPnmlO/31Z0hJVhLBbA29DOTWznKB MQpw==
MIME-Version 1.0
X-Received by 10.68.112.164 with SMTP id ir4mr10433593pbb.153.1394066025300; Wed, 05 Mar 2014 16:33:45 -0800 (PST)
In-Reply-To <CACwCsY4X=yY-xiWgBnaoZ+d0iY=kyZLg_zxuRY=tU-D-McoFZg@mail.gmail.com>
References <CACwCsY65gpn_Zx78wquE-rmrZu10pu9GYbzWd-Y3ypzHsMb2Yw@mail.gmail.com> <CAPTjJmpzpVC-aDX36mQfnLLOPMrrkkaW7tTo=yYJ0bu1XsrPxA@mail.gmail.com> <CACwCsY4X=yY-xiWgBnaoZ+d0iY=kyZLg_zxuRY=tU-D-McoFZg@mail.gmail.com>
Date Thu, 6 Mar 2014 11:33:45 +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.7852.1394066028.18130.python-list@python.org> (permalink)
Lines 44
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1394066028 news.xs4all.nl 2919 [2001:888:2000:d::a6]:36267
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:67898

Show key headers only | View raw


On Thu, Mar 6, 2014 at 11:20 AM, Larry Martell <larry.martell@gmail.com> wrote:
> On Wed, Mar 5, 2014 at 5:39 PM, Chris Angelico <rosuav@gmail.com> wrote:
>> On Thu, Mar 6, 2014 at 9:27 AM, Larry Martell <larry.martell@gmail.com> wrote:
>>> I have a script that forks off other processes and attempts to manage
>>> them. Here is a stripped down version of the script:
>>>
>>>         self.sleepTime = 300
>>
>> That's not a stand-alone script.
>
> No, that is just the part that does the work (inside the 'while
> true'). I'll try and post a standalone script tomorrow.
>
>> What environment is it running in?
>
> CentOS 6,4

That's not the whole environment, though. There's a mention of Django
- does this run inside some framework?

>> Can you reproduce the problem outside of that environment?
>
> I will try that tomorrow.

Running as a stand-alone script, still under CentOS, would be what I
mean by "outside of that environment". I'm talking about making
something that can be saved to my drive and executed, perhaps with a
stubby subprocess script (eg "import time; time.sleep(86400)").

>> Also: Can you simply use multiprocessing rather than going through all
>> the effort of subprocess.Popen?
>
> Perhaps. I didn't write this. A client gave it to me and said 'figure
> out why it uses up all the memory and hangs.' I've messed around with
> for days and cannot see anything that would consume so much memory.

Ah. Yeah, that would be a fun little job to play with. My random
thought: Do the subprocesses produce spammy log output? If so, the
monitor might be collecting it all and holding it in memory in case
you want it (not knowing that you don't). The default should be to
leave them connected to your process's stdio streams, though, so that
shouldn't be the issue.

ChrisA

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


Thread

Re: script uses up all memory Chris Angelico <rosuav@gmail.com> - 2014-03-06 11:33 +1100

csiph-web