import mmap import contextlib import sys print sys.version with open('C:\\bigfile.log', 'r+') as f: with contextlib.closing(mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)) as m: print m.readline().rstrip() When using mmap, a WindowsError: [Error 8] error occurs, which indicates a lack of memory. Why does this error occur and how can it be fixed?
PS File size ~ 2 GB