Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*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; '2.7': 0.13; 'eliminating': 0.16; 'exe': 0.16; 'message-id:@unknownmsgid': 0.16; 'oct': 0.16; 'subject:program': 0.16; 'sync': 0.16; 'syntaxerror:': 0.16; 'traceback.': 0.16; 'true:': 0.16; 'url.': 0.16; 'urllib': 0.16; 'www': 0.16; 'wrote:': 0.17; 'version.': 0.17; '>>>': 0.18; 'windows': 0.19; 'define': 0.20; 'import': 0.21; 'received:209.85.214.174': 0.21; 'converted': 0.22; 'sorry,': 0.22; 'defined': 0.22; 'runs': 0.22; 'cc:2**0': 0.23; 'example': 0.23; 'errors': 0.23; 'task': 0.23; 'script': 0.24; 'pass': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; '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; 'received:google.com': 0.34; 'thanks': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'except': 0.36; 'explain': 0.36; 'loaded': 0.36; 'anything': 0.36; 'should': 0.36; 'two': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'nothing': 0.38; 'advice': 0.39; 'received:209.85.214': 0.39; 'takes': 0.39; 'hello,': 0.39; 'your': 0.60; 'skip:u 10': 0.60; 'ever': 0.63; 'show': 0.63; 'decided': 0.65; 'else.': 0.65; 'useful.': 0.65; '2.7.': 0.84; 'ini': 0.84; 'running,': 0.84; 'angel': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:from:mime-version:in-reply-to:date:message-id:subject:to :cc:content-type; bh=CwyhFhOqcTe6zOjnYtBcAe0Ehf+93l7+W6Oyq8oigQ8=; b=QIln+kKXry2kKCH7GAxR1VfoiCqxkYZnl7y4HBoins0JRLQBLZ4D6+fEJCQX4WoW27 fWLTZPTwDPZG53OxnHvLSXpGFjA440mMukhcWrMKLVpKCCM66ImxcVRlY0gY2j/I79Bj NIXJ8o1t9YKmy3j/y8OJ29fF/+76VbNQguwoMRT3G7YR36IKLwZXw+is4cJdzL3Ktp9N d8U9FOc4oLYBeQj7Zj/R6ruZqJK9e6W77D2jAFPOR50fPwHaytzgWuAa4KZaYSIIiknp wiCgx8/DBPIGonGlhEDSVq6X8QIJan/2xyE/8vQUE3/BFZK1pwmrECago+vDYDnZMDCt bfqA== References: <50849151.1080807@davea.name> From: Anatoli Hristov Mime-Version: 1.0 (1.0) In-Reply-To: <50849151.1080807@davea.name> Date: Mon, 22 Oct 2012 02:31:58 +0200 Subject: Re: program loaded in memory To: "d@davea.name" Content-Type: text/plain; charset=UTF-8 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 70 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1350865921 news.xs4all.nl 6973 [2001:888:2000:d::a6]:37472 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31870 Yes sorry, the name var(interval) is loaded from the ini file and also the Url. The reason is that the ini file will be configured from someone else. Example of the file URL = www # define your url interval = 1 # minutes for sync I see in the task manager each time it downloads the file that it grows up with 30kb. And I'm using Python 2.7 on windows 7 Thanks On 22 Oct 2012, at 02:21, Dave Angel wrote: > 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 >