title: Reading a large text file in python kills my program
body: <p>I wrote a python script to read in a text file and put its information in a Dictionary. The original text file is 2.6 gb and contains 56981936 lines, of these lines I only need to link every first line to its second and fourth in a dictionary. I recently switched from windows (were this program ran fine) to Linux, where it keeps getting killed. Does somebody have any idea why?</p>
  
  <p>The text format is a fastQ file, which has repeating lines in the following format:</p>
  
  <pre><code>@xxxxxxxxxxx
  CTTCTCAACTC
  +
  AAAEE#AEE#A
  </code></pre>
  
  <p>This is my original code:</p>
  
  <pre class="lang-py prettyprint-override"><code>def createReverseDict(backwardsFile):
      reverseDict = {}
      with open(backwardsFile) as f3:
              while True:
                  label       = f3.readline().rstrip()
                  if not label:
                      break
                  sequence    = f3.readline().rstrip()
                  next(f3)
                  score       = f3.readline().rstrip()
                  reverseDict[label] = {"sequence" : sequence,
                                      "score"    : score   }
      return reverseDict
  </code></pre>