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


Groups > comp.lang.python > #31869 > unrolled thread

Re: program loaded in memory

Started byDave Angel <d@davea.name>
First post2012-10-21 20:20 -0400
Last post2012-10-21 20:20 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#31869 — Re: program loaded in memory

FromDave Angel <d@davea.name>
Date2012-10-21 20:20 -0400
SubjectRe: program loaded in memory
Message-ID<mailman.2610.1350865265.27098.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web