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


Groups > comp.lang.python > #31760

RE: Python does not take up available physical memory

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 <ramit.prasad@jpmorgan.com>
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" <ramit.prasad@jpmorgan.com>
To "python-list@python.org" <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> <k5s743$6jl$1@ger.gmane.org>
In-Reply-To <k5s743$6jl$1@ger.gmane.org>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2526.1350674272.27098.python-list@python.org> (permalink)
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

Show key headers only | View raw


Emile van Sebille wrote:
> On 10/19/2012 10:08 AM, Pradipto Banerjee wrote:
> > Hi,
> >
> > I am trying to read a file into memory. The size of the file is around 1
> > GB. I have a 3GB memory PC and the Windows Task Manager shows  2.3 GB
> > available physical memory when I was trying to read the file. I tried to
> > read the file as follows:
> >
> >>>> fdata = open(filename, 'r').read()
> >
> > I got a "MemoryError". I was watching the Windows Task Manager while I
> > run the python command, and it appears that python **perhaps** never
> > even attempted to use more memory but gave me this error.
> >
> > Is there any reason why python can't read a 1GB file in memory even when
> > a 2.3 GB physical memory is available?
> 
> The real issue is likely that there is more than one copy of the file in
> memory somewhere.  I had a similar issue years back that I resolved by
> using numeric (now numpy?) as it had a more efficient method of
> importing content from disk.
> 
> Also realize that windows may not allow the full memory to user space.
> I'm not sure what exactly the restrictions are, but a 4Gb windows box
> doesn't always get you 4Gb of memory.
> 

Windows (by default) limits user space of a 32 bit machine to 2 GB.
This is a bit old but I think still applies to pre-Win7. 
(scroll down to "32-bit Client Effective Memory Limits" )
http://blogs.technet.com/b/markrussinovich/archive/2008/07/21/3092070.aspx

Offhand, I am not sure how this works in Win7, but for 32-bit clients
I doubt it has changed much.
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

RE: Python does not take up available physical memory "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-10-19 19:17 +0000

csiph-web