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


Groups > comp.lang.python > #31869

Re: program loaded in memory

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'syntax': 0.03; 'memory.': 0.05; 'try:': 0.07; 'python': 0.09; 'differently.': 0.09; 'ioerror:': 0.09; 'loop.': 0.09; 'modifies': 0.09; 'nameerror:': 0.09; 'cc:addr:python-list': 0.10; 'eliminating': 0.16; 'exe': 0.16; 'subject:program': 0.16; 'syntaxerror:': 0.16; 'traceback.': 0.16; 'true:': 0.16; 'urllib': 0.16; 'wrote:': 0.17; 'version.': 0.17; 'import': 0.21; 'converted': 0.22; 'defined': 0.22; 'runs': 0.22; 'cc:2**0': 0.23; 'errors': 0.23; 'cc:no real name:2**0': 0.24; 'script': 0.24; 'pass': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'skip:" 20': 0.26; "doesn't": 0.28; 'skip:( 20': 0.28; 'actual': 0.28; 'run': 0.28; 'post': 0.28; 'loop,': 0.29; "i'm": 0.29; 'call.': 0.30; 'code': 0.31; 'file': 0.32; 'loading': 0.33; 'ram': 0.33; 'thanks': 0.34; 'pm,': 0.35; 'something': 0.35; 'there': 0.35; 'except': 0.36; 'explain': 0.36; 'anything': 0.36; 'should': 0.36; 'two': 0.37; 'subject:: ': 0.38; 'nothing': 0.38; 'advice': 0.39; 'takes': 0.39; 'received:192': 0.39; 'hello,': 0.39; 'received:192.168': 0.40; 'skip:u 10': 0.60; 'ever': 0.63; 'show': 0.63; 'decided': 0.65; 'useful.': 0.65; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; '>from': 0.75; '2.7.': 0.84; 'ini': 0.84; 'running,': 0.84
Date Sun, 21 Oct 2012 20:20:33 -0400
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120912 Thunderbird/15.0.1
MIME-Version 1.0
To Anatoli Hristov <tolidtm@gmail.com>
Subject Re: program loaded in memory
References <CAKhY55NWpOxpTdTNi6i1vio0u9utL72Gq6CA1w81QFNmQz8+RQ@mail.gmail.com>
In-Reply-To <CAKhY55NWpOxpTdTNi6i1vio0u9utL72Gq6CA1w81QFNmQz8+RQ@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:1DpG2rItT7sAsN6y4N0zb8nK3HjxXCcById3UKLCSs1 khaslHhm/U2xhmW4C4YSvo77+AUbJlW8qiq4kBnaKQ9rVc6zzu EuDOto2TmoGjATCcYYdnK6rVTSrANf85wFnLJkZQV6kGQtwAZK 15FkHYOjQIWoITkXZspVDcc+sEbWEVTxfoUbAUX2uyFyVomfqs xAbwSLiNf+YUnKqr5/C5l1h0JFscHzv6PvSB5JxCACpI5iTgtP CfwHpGAYHS2Edri5ecNu7AI43mAHd+tihbWihSA+8LaIj76vdz AktDw3xjUXFsXdw+fwJFHrMunqcS7+NMrwMXxta9gcaa86mCQ= =
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To d@davea.name
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2610.1350865265.27098.python-list@python.org> (permalink)
Lines 54
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1350865265 news.xs4all.nl 6925 [2001:888:2000:d::a6]:57649
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31869

Show key headers only | View raw


On 10/21/2012 08:02 PM, Anatoli Hristov wrote:
> Hello,
>
> I need an advice about a small script I run 24/24 7/7.
>
> It's a script converted to EXE using py2exe and this script takes -
> grows 30kb RAM on each loop which means that for 10hours it grows up
> with 180mb memory. is there something I can do ?
> >From the ini file I'm loading only the URL and the interval of
> downloading the file
> The script:
>
> import time
> import urllib
>
> exec(open("iccm.ini").read())

This line doesn't do anything useful.  And I would start by eliminating
the exec() call.

>
> loop = 0
> while loop == 0:
Since nothing ever modifies loop, you should just make it

    while True:
>
>     time.sleep(interval*60)

NameError: name 'interval' is not defined

>     try:
>         urllib.urlretrieve ('"'URL'"'+"/hours.xml", "c:\\config\\hours.xml")

SyntaxError: invalid syntax

>     except IOError:
>         pass
>
> Thanks

Please post the actual code you're running, as well as the Python
version.  Also, explain how you decided that it grows by 30kb each loop.

You also should try the same code without py2exe;  see if it runs any
differently.

The two errors I show are from Python 2.7. Naturally, if you post an
error, you should give the full traceback.

-- 

DaveA

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


Thread

Re: program loaded in memory Dave Angel <d@davea.name> - 2012-10-21 20:20 -0400

csiph-web