title: File.ReadAllText leading to memory leak
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3336908/textbox-text-leaking-memory-in-wpf-application">TextBox.Text Leaking Memory in WPF Application</a>  </p>
  </blockquote>
  
  
  
  <p>I've got an application trailing a logfile. Every time the logfile updates (which is usually a series of updates in a row) the memory use balloons out of control.</p>
  
  <p>I've tracked down the problem to this call:</p>
  
  <pre><code>    if (File.Exists(Path + "\\logfile.txt"))
                  Data = File.ReadAllText(Path + "\\logfile.txt");
  </code></pre>
  
  <p>This is being called from within LoadAllData, here.</p>
  
  <pre><code>    private void FileChangeNotificationHandler(object source, FileSystemEventArgs e)
      {
          this.Dispatcher.BeginInvoke
            (new Action(delegate()
            {
                Logfile.GetPath();
                Logfile.LoadAllData();
  
                LogText.Clear();
                LogText.Text = Logfile.Data;
                if (CheckFollowTail.IsChecked == true) LogText.ScrollToEnd();
            }));
      }
  </code></pre>
  
  <p>Does anyone have insight on why this occurring? I assume it's related to the delegate or the handler.</p>