title: How do I release the memory from a DataTable that I have cleared and set to null?
body: <p>I've been writing a small database application designed around an sqlite backend. As part of this I've included some query functionality into my GUI so that the user can get at the data they need. The data is loaded into a DataTable and eventually makes it's way to a datagridview in a dockable window. The problem I have is that when I close the window, the memory from the DataTable is not released. I've done some testing which involved running a query, filling the DataTable from an SQLiteDataAdapter, immediately running <code>.Clear()</code> and <code>.Dispose()</code> on the DataTable and finally setting the DataTable to null. The memory usage still persists. I'm almost positive it is the DataTable as the memory usage goes up by about 170mb when I fill the DataTable from the adapter. How do I get my memory back!? ;-)</p>
  
  <p>method to fill datatable:</p>
  
  <pre><code>internal static DataTable RawQuery(string sql)
  {
      DataTable dt = new DataTable();
      SQLiteDataAdapter da = new SQLiteDataAdapter(sql, conn);
      try
      {
          da.Fill(dt);
          return dt;
      }
      catch (SQLiteException ex)
      {
          MessageBox.Show(ex.Message);
          return null;
      }
  }
  </code></pre>
  
  <p>snippet from calling method:</p>
  
  <pre><code>Thread thread = new Thread(() =&gt; {
  
      mainForm.Invoke(new Action(() =&gt; 
      {
          mainForm.myStatusLabel.Text = "Executing query...";
          mainForm.myProgressBar.Style = ProgressBarStyle.Marquee;
          mainForm.myProgressBar.Visible = true;
      }));
  
      try
      {
          Database.CreateQueryTempTable(title, query);
          dt = Database.RawQuery("SELECT * FROM " + title + ";");
  
          if (dt == null)
              return;
  
          // TEST***************
          dt.Clear();
          dt.Dispose();
          dt = null;
          //********************
  
          //...etc.
      }
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>To clarify, every time a query is run, memory usage increases (presumably until I get a stackoverflow, I haven't pushed it this far yet). The allocated memory is not being recycled .</p>