title: System.OutOfMemoryException with JSON.NET with List<object>
body: <p>I'm doing a process where my server generates a file with JSON.Net with 25000 records and size of 85MB, then this file is imported by client.</p>
  
  <p>The client downloads the file and makes the deserialize with JSON.Net.</p>
  
  <p>My problem is that the times and on different machines, deserialize command is giving:</p>
  
  <p><code>System.OutOfMemoryException</code></p>
  
  <p>Note: I tried to manually use the GC did not work.</p>
  
  <h3>Code generate error:</h3>
  
  <pre><code>var listAddress = JsonConvert.DeserializeObject&lt;List&lt;address&gt;&gt;(File.ReadAllText(@"c:\Temp\test.json");
  </code></pre>
  
  <h3>Code generate JSON File:</h3>
  
  <pre><code>using (StreamWriter file = File.CreateText("C:\\test.json"))
  {
      JsonSerializer serializer = new JsonSerializer();                        
      serializer.Serialize(file, listAddress);                        
  }
  </code></pre>
  
  <h3>My Class Address</h3>
  
  <pre><code>public class Endereco
  {
      public int Codigo { get; set; }
      public string CGCCPF { get; set; }
      public char? TipoPessoa { get; set; }
      public string UF { get; set; }
      public string SiglaDoRG { get; set; }
      public string MaeFantasica { get; set; }
      public string DescEndereco { get; set; }
      public string Complemento { get; set; }
      public string Bairro { get; set; }
      public string CEP { get; set; }
      public string Pai { get; set; }
      public string Cidade { get; set; }
      public string Telefone { get; set; }
      public string Fax { get; set; }
      public string Email { get; set; }
      public string IEouRG { get; set; }
      public string OrgaoEmissorRG { get; set; }
      public DateTime? DataNascimento { get; set; }
      public CampoObservacao Observacao { get; set; }
      public DateTime? DataRegistro { get; set; }
      public DateTime? DataUltAlteracao { get; set; }
      public int? CodigoFuncionario { get; set; }
      public string Ramal { get; set; }
      public DateTime? DataDeEmissaoRG { get; set; }
      public string Alfa1 { get; set; }
      public string Alfa2 { get; set; }
      public double? Num1 { get; set; }
      public double? Num2 { get; set; }
      public string PontoReferencia { get; set; }
      public string Celular { get; set; }
      public string EnderecoWeb { get; set; }
      public string Conta { get; set; }
      public string Rasocial { get; set; }
      public int? NcCodigo { get; set; }
      public int? NcCodigoC { get; set; }
      public string CFOP { get; set; }
      public string Numero { get; set; }
      public int? CodigoMunicipio { get; set; }
      public int? CodigoPais { get; set; }
      public string Suframa { get; set; }
      public string NumeroNit { get; set; }
      public string InscricaoMunicipal { get; set; }
      public string IE { get; set; }
  
      public bool Ativo
      {
          get { return !Observacao["Status"].Equals("I"); }
          set { Observacao["Status"] = !value ? "I" : String.Empty; }
      }
  
      public Endereco()
      {
          Observacao = new CampoObservacao();
      }
  
      public char? TipoDeMercado
      {
          get { return !String.IsNullOrEmpty(Observacao["Tipo de Mercado"]) ? (char?)Observacao["Tipo de Mercado"][0] : null; }
          set { Observacao["Tipo de Mercado"] = value.HasValue ? value.ToString() : String.Empty; }
      }
  
      public char? EstadoCivil
      {
          get { return !String.IsNullOrEmpty(Observacao["EstadoCivil"]) ? (char?)Observacao["EstadoCivil"][0] : null; }
          set { Observacao["EstadoCivil"] = value.HasValue ? value.ToString() : String.Empty; }
      }
  
      public Cliente Cliente { get; set; }
      public Funcionario Funcionario { get; set; }
      public Filial Filial { get; set; }
  }
  </code></pre>