Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Python does not take up available physical memory

Reply
Thread Tools

Re: Python does not take up available physical memory

 
 
Chris Angelico
Guest
Posts: n/a
 
      10-20-2012
On Sat, Oct 20, 2012 at 9:22 AM, Pradipto Banerjee
<> wrote:
> Dennis,
>
> 1. Yes, .readlines() work where .read() fails. Thanks for the suggestion - this has really given a big boost to the size of the data I can read.


If at all possible, consider reading the file iteratively and
retaining only the current line. You say you need to "compare one line
versus another" - are you able, for instance, to sort the file
(externally; I think every OS these days will have a sort utility that
can handle files >RAM) and then compare the current line against a
small amount of retained state? This sort (pun intended) of trick can
not only get you past the limit, it will often improve running time
enormously too.

ChrisA
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Python does not take up available physical memory Pradipto Banerjee Python 6 10-21-2012 02:14 PM
Re: Python does not take up available physical memory Emile van Sebille Python 0 10-20-2012 06:46 AM
RE: Python does not take up available physical memory Pradipto Banerjee Python 1 10-19-2012 09:37 PM
Re: Python does not take up available physical memory MRAB Python 0 10-19-2012 07:13 PM
Re: Python does not take up available physical memory Ian Kelly Python 0 10-19-2012 06:48 PM



Advertisments