Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'case.': 0.05; 'discard': 0.05; 'that?': 0.05; 'elegant': 0.07; 'function,': 0.07; 'subject:How': 0.09; 'python': 0.09; 'cc:addr :python-list': 0.10; 'subject:error': 0.11; 'subject:python': 0.11; 'suggest': 0.11; 'advance.': 0.15; '4gb': 0.16; 'bits,': 0.16; 'determining': 0.16; 'function).': 0.16; 'generators.': 0.16; 'globals.': 0.16; 'range.': 0.16; 'simplest': 0.16; 'xrange': 0.16; 'wrote:': 0.17; 'memory': 0.18; 'python?': 0.20; 'regardless': 0.21; '(by': 0.22; 'lets': 0.22; 'os,': 0.22; 'cc:2**0': 0.23; 'example': 0.23; 'posts': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'wondering': 0.26; 'am,': 0.27; 'in.': 0.27; 'installing': 0.27; 'actual': 0.28; 'run': 0.28; 'post': 0.28; 'environment': 0.29; 'high.': 0.29; 'objects': 0.29; 'version,': 0.30; 'error': 0.30; 'computer.': 0.32; 'running': 0.32; 'message.': 0.33; 'limitations': 0.33; 'another': 0.33; 'version': 0.34; 'done': 0.34; 'thanks': 0.34; 'returning': 0.35; 'solving': 0.35; 'there': 0.35; 'but': 0.36; 'limitation': 0.36; 'subject:with': 0.36; 'operating': 0.36; 'option': 0.37; '(for': 0.37; 'previous': 0.37; 'rather': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'nothing': 0.38; 'sure': 0.38; 'instead': 0.39; 'received:192': 0.39; 'little': 0.39; 'received:192.168': 0.40; 'your': 0.60; 'address': 0.60; 'most': 0.61; 'first': 0.61; 'maximum': 0.63; 'different': 0.63; 'here': 0.65; 'total': 0.65; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'to:addr:yahoo.com': 0.80; 'foremost,': 0.84; 'received:74.208.4.194': 0.84; 'subject:32bit': 0.84; 'tied': 0.93 Date: Tue, 24 Jul 2012 05:58:25 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Sammy Danso Subject: Re: How to deal with python 32bit memory error References: <1343117176.63442.YahooMailClassic@web161206.mail.bf1.yahoo.com> In-Reply-To: <1343117176.63442.YahooMailClassic@web161206.mail.bf1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:zi+RYJY8q37pXByjFcBk4gbfwfXm73/O+d4x8LQgJVE AShMp2AfK70kTA3iYFzZHIS/fdMYvuqCXiugJyf1Qx5Q/Qmrts 81iTgN6bLQwqcGPl/pzA9VyA/k7vdvVKL63fDVXfc1R2dAbPnf rQJDpxdM1/A1SLT5O+2izrn7MABmGJn/ROKlG8UPZ7HpInj3G5 RCIIuOBKNBrievCGSK/dKllTQqS6HM+Dd9vFy6J+U/1Kdv4Wn2 Y1e582mdthhO3P9IyAqQ//nvTgIsRyZD0MKmksVko1nmDpDVkV RegZgrtdnPP5WtbOqXEr1Du0C9ayqwpdtB+RBBALBYZrxADHQ= = Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: d@davea.name 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: 50 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1343123938 news.xs4all.nl 6888 [2001:888:2000:d::a6]:35315 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25974 On 07/24/2012 04:06 AM, Sammy Danso wrote: > Hello Experts, > I am having a 'memory error', Please post the actual error message. > which suggest that I > have run out of memory, but I am not sure this is the case as I have > considerable amount of memory unused on my computer. What OS, version, and bitness. What 32bit Python? How do you know you have unused memory? How much total memory, how much swapspace, and what are you using to tell how much of each is unused? How big is the process when it dies? And how are you determining that? > A little > search suggest this is a limitation of python 32 and an option is to > have a 64bit. I however have other plug-ins, which are tied to the 32bit > so this is not the best option in my case. There are some limitations to 32 bits, that have nothing to do with Python specifically. However, they have different impact, depending on the environment you're running in. First and foremost, address are 32bits, which limits them to 4gb of ram. So out of your 32Gig of swapspace, a best-case maximum regardless of OS is 4Gig. No operating system lets you actually get that high. > I was wondering whether there is an elegant way to dealing with this without installing a 6bit version of python. The most elegant way of solving it is to reduce the amount of memory your program is using. For example, instead of building large lists, perhaps you can use generators. Simplest example (for Python 2.x) is xrange rather than range. For another example, reduce the globals. Create large objects inside a limited function, and discard them when done (by returning from the function). > Thanks very much in advance. > Sammy > When responding, please remember to post your response *AFTER* the part you're quoting. Most of your previous posts here have been top-posted. -- DaveA