title: App works fine, so can I ignore "CursorWindow: Window is full: requested allocation 12 bytes, free space 4 bytes, window size 2,097,152 bytes"?
body: <p>I have a 176,000 word SQLite database and an app that searches it (via an <code>IntentService</code>) and works great, never crashing. Even if thousands of "hits" are returned, the user can scroll through the list quickly and seamlessly. But I often-to-maybe-always get the Logcat warning message shown in the Title.</p>
  
  <p>I've use a <code>Cursor</code> to access the database data and a <code>TextView</code> inside a <code>ScrollView</code>, as shown:</p>
  
  <p></p>
  
  <pre><code>&lt;ScrollView
  ...&gt;
      &lt;TextView
          android:id=                     "@+id/txaMatches"
          android:scrollbars=             "vertical"
      .../&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p></p>
  
  <p>code:</p>
  
  <pre><code>  // initialize, etc.
    Cursor cursor = mdatabase.query(TABLE_NAME, mColumns, whereClause,
                                    wildCardReplacements, null, null, WORD_COLUMN_NAME);
    nRows = cursor.getCount();
    while (n &lt;= prefMaxMatches &amp;&amp; i &lt; nRows) {
      cursor.moveToPosition(i);
      // do stuff
    }
  </code></pre>
  
  <p>But the warning makes me wonder if making a change in the code to get rid of it might improve responsiveness. Some searches take awhile (i.e., output not immediate, but given in a reasonable time period), depending on the <code>Pattern</code> entered (e.g., <code>*</code> must search all 176,000 words). Anyone could live with it, but we always want more speed.</p>
  
  <p>What should I do? Just ignore the warning since it causes no apparent unacceptable action (e.g., crashing, slow execution)? Or what?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Pztar suggests using <code>LIMIT 50</code> in the query, but it's not entirely clear how to do so. Here's how--append <code>LIMIT 50</code> to the "order by" column name (which, for me, is <code>WORD_COLUMN_NAME</code>): </p>
  
  <pre><code>String __whereClause = "word like ?"; 
  String[] __wildCardReplacements = {pattern}; 
  cursor = mdatabase.query(TABLE_NAME, mColumns, __whereClause,
                           __wildCardReplacements, null, null, 
                           WORD_COLUMN_NAME + " LIMIT 50");
  </code></pre>
  
  <p>--or, as better suggested by cricket_007,--</p>
  
  <p>use the version of the call to <code>query</code> that has one more parameter:</p>
  
  <pre><code>cursor = mdatabase.query(TABLE_NAME, mColumns, __whereClause,
                           __wildCardReplacements, null, null, 
                           WORD_COLUMN_NAME, "50");
  </code></pre>