title: Clean memory after using a large list of data in WCF Service
body: <p>I have a WCF client and I connect to a WCF server hosted in a Windows service. In the service I read the last day entries from the Security event log. Then I parse the entries and create my own <code>List&lt;Data&gt;</code> which I return to my WCF client to display it in a DataGrid. The problem is that in the Security event log I have 30000 entries and after I parse every entry I create 30000 of new objects of type <code>Data</code>. This type is a class with 15 string properties which contains the details from the messages from the event log. After the whole process, the memory usage of the Windows service goes up with 60-70MB. Once I send this large set of data to the client, how can I lower the memory used by Windows service from 70-80MB to the default 10MB ?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public List&lt;Data&gt; GetConnections()
  {        
     var eventLog = new EventLog("Security");
     var fromDate = DateTime.Now.AddDays(-1);
     var entries = (from EventLogEntry e in eventLog.Entries
                     where (e.InstanceId == m_EventNumber) &amp;&amp; e.TimeGenerated &gt;= fromDate orderby e.TimeGenerated
                     select e).ToList()
                              .OrderByDescending(x =&gt; x.TimeGenerated);
  
     var items = new List&lt;Data&gt;();
     foreach(var item in entries)
     {
        var nData = ParseMessage(item.Message);
        if (nData != null)
            items.Add(ruleData);
     }
     return items;
  }
  </code></pre>