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


Groups > comp.lang.python > #31869

Re: program loaded in memory

Date 2012-10-21 20:20 -0400
From Dave Angel <d@davea.name>
Subject Re: program loaded in memory
References <CAKhY55NWpOxpTdTNi6i1vio0u9utL72Gq6CA1w81QFNmQz8+RQ@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2610.1350865265.27098.python-list@python.org> (permalink)

Show all headers | 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