title: What does 'killed' mean when processing a huge CSV with Python, which suddenly stops?
body: <p>I have a Python script that imports a large CSV file and then counts the number of occurrences of each word in the file, then exports the counts to another CSV file.</p>
  
  <p>But what is happening is that once that counting part is finished and the exporting begins it says <code>Killed</code> in the terminal.</p>
  
  <p>I don't think this is a memory problem (if it was I assume I would be getting a memory error and not <code>Killed</code>).</p>
  
  <p>Could it be that the process is taking too long? If so, is there a way to extend the time-out period so I can avoid this?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>csv.field_size_limit(sys.maxsize)
      counter={}
      with open("/home/alex/Documents/version2/cooccur_list.csv",'rb') as file_name:
          reader=csv.reader(file_name)
          for row in reader:
              if len(row)&gt;1:
                  pair=row[0]+' '+row[1]
                  if pair in counter:
                      counter[pair]+=1
                  else:
                      counter[pair]=1
      print 'finished counting'
      writer = csv.writer(open('/home/alex/Documents/version2/dict.csv', 'wb'))
      for key, value in counter.items():
          writer.writerow([key, value])
  </code></pre>
  
  <p>And the <code>Killed</code> happens after <code>finished counting</code> has printed, and the full message is: </p>
  
  <pre><code>killed (program exited with code: 137)
  </code></pre>