Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeder.erje.net!multikabel.net!newsfeed20.multikabel.net!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.85.MISMATCH!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; 'importing': 0.04; 'subject:Python': 0.05; 'memory.': 0.05; 'completeness': 0.07; 'space.': 0.07; 'python': 0.09; '32-bit': 0.09; 'default)': 0.09; 'received:155': 0.09; 'url:archive': 0.09; 'subject:not': 0.11; 'applies': 0.15; "'r').read()": 0.16; '(now': 0.16; '4gb': 0.16; 'command,': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'disk.': 0.16; 'from:addr:jpmorgan.com': 0.16; 'received:155.180': 0.16; 'received:155.180.234': 0.16; 'received:159.53': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:svr.bankone.net': 0.16; 'securities,': 0.16; 'somewhere.': 0.16; 'url:blogs': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'wrote:': 0.17; 'resolved': 0.17; 'restrictions': 0.17; 'appears': 0.18; 'memory': 0.18; 'windows': 0.19; 'to:name:python-list@python.org': 0.20; 'file.': 0.20; 'trying': 0.21; 'bit': 0.21; 'error.': 0.21; '(by': 0.22; 'task': 0.23; 'received:169.254': 0.24; 'machine': 0.24; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'realize': 0.27; '2.3': 0.27; 'accuracy': 0.27; "doesn't": 0.28; 'run': 0.28; '>>>>': 0.29; 'attempted': 0.29; 'url:2008': 0.29; 'received:169': 0.29; 'van': 0.29; "i'm": 0.29; 'header:Received:8': 0.30; 'file': 0.32; 'doubt': 0.33; 'much.': 0.33; 'to:addr:python-list': 0.33; 'likely': 0.33; 'hi,': 0.33; "can't": 0.34; 'changed': 0.34; 'follows:': 0.35; 'similar': 0.35; 'there': 0.35; 'but': 0.36; 'method': 0.36; 'client': 0.36; 'charset:us-ascii': 0.36; 'why': 0.37; 'subject:: ': 0.38; 'sure': 0.38; 'shows': 0.38; 'to:addr:python.org': 0.39; 'space': 0.39; 'skip:" 10': 0.40; 'think': 0.40; 'url:aspx': 0.60; 'real': 0.61; 'back': 0.62; 'effective': 0.63; 'information,': 0.63; 'url:email': 0.63; 'more': 0.63; 'gave': 0.65; 'legal': 0.65; 'watching': 0.65; 'subject': 0.66; 'purchase': 0.67; 'physical': 0.69; 'sale': 0.76; '1gb': 0.84; 'received:169.254.8': 0.84; 'subject:available': 0.96 X-DKIM: OpenDKIM Filter v2.1.3 sf3.jpmchase.com q9JJHgXR032139 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpmorgan.com; s=smtpout; t=1350674262; bh=2ZdDop9H9I1oa9P2F9RgECIacxRtEMubS1xvh5tkgUg=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=a9w1F18DdGAoYJYmLn7ZQYO15tzL9K2BStyNDSMo4yXoG7GZ96Rb1IY5x2LiH0RpZ lxB15bgKCFBDUjb3fkIxSIidflzYBS0wS+OKVNrcrw26n6qIU1vXqn1kG7COkQtlyQ Lz4QG3C9/FqINFN9VGYSTW57pwSvyj2kAbGs8s8A= From: "Prasad, Ramit" To: "python-list@python.org" Subject: RE: Python does not take up available physical memory Thread-Topic: Python does not take up available physical memory Thread-Index: Ac2uHGpaUb5JSqdJR1m8LKyDAm0X3wAk7LKAACCWfZA= Date: Fri, 19 Oct 2012 19:17:29 +0000 References: <76D03718A3233B4C8CC236C169B535B5A23E063E45@AUSP01VMBX08.collaborationhost.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.79.47] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes Content-Type: text/plain; charset="us-ascii" 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1350674272 news.xs4all.nl 6946 [2001:888:2000:d::a6]:52160 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31760 Emile van Sebille wrote:=0D=0A> On 10/19/2012 10:08 AM, Pradipto Banerjee w= rote:=0D=0A> > Hi,=0D=0A> >=0D=0A> > I am trying to read a file into memory= =2E The size of the file is around 1=0D=0A> > GB=2E I have a 3GB memory PC = and the Windows Task Manager shows 2=2E3 GB=0D=0A> > available physical me= mory when I was trying to read the file=2E I tried to=0D=0A> > read the fil= e as follows:=0D=0A> >=0D=0A> >>>> fdata =3D open(filename, 'r')=2Eread()= =0D=0A> >=0D=0A> > I got a "MemoryError"=2E I was watching the Windows Task= Manager while I=0D=0A> > run the python command, and it appears that pytho= n **perhaps** never=0D=0A> > even attempted to use more memory but gave me = this error=2E=0D=0A> >=0D=0A> > Is there any reason why python can't read a= 1GB file in memory even when=0D=0A> > a 2=2E3 GB physical memory is availa= ble?=0D=0A> =0D=0A> The real issue is likely that there is more than one co= py of the file in=0D=0A> memory somewhere=2E I had a similar issue years b= ack that I resolved by=0D=0A> using numeric (now numpy?) as it had a more e= fficient method of=0D=0A> importing content from disk=2E=0D=0A> =0D=0A> Als= o realize that windows may not allow the full memory to user space=2E=0D=0A= > I'm not sure what exactly the restrictions are, but a 4Gb windows box=0D= =0A> doesn't always get you 4Gb of memory=2E=0D=0A> =0D=0A=0D=0AWindows (by= default) limits user space of a 32 bit machine to 2 GB=2E=0D=0AThis is a b= it old but I think still applies to pre-Win7=2E =0D=0A(scroll down to "32-b= it Client Effective Memory Limits" )=0D=0Ahttp://blogs=2Etechnet=2Ecom/b/ma= rkrussinovich/archive/2008/07/21/3092070=2Easpx=0D=0A=0D=0AOffhand, I am no= t sure how this works in Win7, but for 32-bit clients=0D=0AI doubt it has c= hanged much=2E=0D=0AThis email is confidential and subject to important dis= claimers and=0D=0Aconditions including on offers for the purchase or sale o= f=0D=0Asecurities, accuracy and completeness of information, viruses,=0D=0A= confidentiality, legal privilege, and legal entity disclaimers,=0D=0Aavaila= ble at http://www=2Ejpmorgan=2Ecom/pages/disclosures/email=2E