title: Sqlite running out of memory on a python call
body: <p>So, when I run my code, which is pulling a lot of data from a sqlite database,</p>
  
  <p>I get the following error in my python code!</p>
  
  <pre><code>(&lt;type 'exceptions.MemoryError'&gt;, 'main.py', 427)
  </code></pre>
  
  <p>Yes, the above exception is some of my own error formatting. </p>
  
  <p>Before it was just printing <code>MemoryError</code></p>
  
  <p>This is what I have on line 427:</p>
  
  <pre><code>rows=cur.fetchall()
  </code></pre>
  
  <p>Then I assumeed the problem has to do with memory: 
  so I did the following</p>
  
  <pre><code>sqlite&gt; PRAGMA page_size = 1073741824;
  sqlite&gt; PRAGMA cache_size = 100000;
  sqlite&gt; VACUUM;
  
  
  sqlite&gt; PRAGMA page_size;
  4096
  Memory Used:                         50186800 (max 100373936) bytes
  Number of Outstanding Allocations:   12075 (max 24216)
  Number of Pcache Overflow Bytes:     50045536 (max 100095168) bytes
  Number of Scratch Overflow Bytes:    0 (max 11392) bytes
  Largest Allocation:                  469214 bytes
  Largest Pcache Allocation:           4244 bytes
  Largest Scratch Allocation:          11392 bytes
  Lookaside Slots Used:                0 (max 0)
  Successful lookaside attempts:       0
  Lookaside failures due to size:      0
  Lookaside failures due to OOM:       0
  Pager Heap Usage:                    49904696 bytes
  Page cache hits:                     2011
  Page cache misses:                   21561
  Page cache writes:                   11780
  Schema Heap Usage:                   7296 bytes
  Statement Heap/Lookaside Usage:      1448 bytes
  Fullscan Steps:                      0
  Sort Operations:                     0
  Autoindex Inserts:                   0
  sqlite&gt;
  
  
  sqlite&gt; .version
  SQLite 3.7.13 2012-06-11 02:05:22
  </code></pre>
  
  <p>But I still get the same error.</p>
  
  <p>Thoughts?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Per answer blow, attempted:</p>
  
  <pre><code>rows = []
  while True:
     rows.append(cur.fetchone())
  </code></pre>
  
  <p>But the same result.</p>