How i can clear IEnumerable<ImapX.Messages>?
<p>I downloaded all the messages and checked their attachment . They are filling RAM. I am called that code in threads. I am try to use  client.Dispose() and GC.Collect() but is is not helped :(( 
<a href="https://i.stack.imgur.com/rG98N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rG98N.png" alt="enter image description here"></a></p>

<pre><code>using (var client = new ImapClient(hostname, true))
{
    if (client.Connect( /* optional, use parameters here */ ))
    {
        // connection successful
        if (client.Login(login, pass))
        {
            // login successful
            FolderCollection folders = client.Folders;
            int i = 0;
            foreach (Folder myfolder in folders)
            {

                var messages = client.Folders[i].Search("ALL");
                i++;
                foreach (var message in messages)
                {
                    var attachments = message.Attachments;
                    if (attachments.Count() &gt; 0)
                        if (!Directory.Exists(folder + @"\" + login))
                        {
                            DirectoryInfo di = Directory.CreateDirectory(folder + @"\" + login);// Try to create the directory.
                        }
                    foreach (var attachment in attachments)
                    {
                        attachment.Download();
                        attachment.Save(folder + @"\" + login);
                    }
                }

                GC.Collect();
            }
        }
    }
    client.Disconnect();
    client.Dispose();
}
</code></pre>