in reply to Why I got nearly out of memory, and never recover from that?

You haven't said what kind of processing you're doing, but, in the vast majority of cases, you don't actually need to load the whole file into memory. If the files have any kind of internal structure, you can probably read them in corresponding chunks - whether that's line-by-line or record-by-record - to do your processing with only one chunk (or maybe a small number of chunks, depending on the nature of your processing) in memory at a time.

If your processing amounts to "read in the whole file, then loop over pieces of the file to handle each piece in turn", then you almost certainly do not need to read it all in at once.

  • Comment on Re: Why I got nearly out of memory, and never recover from that?