| Author |  | 
      
        | ramiss Newbie
 
  
  
 Joined: 18 March 2009
 Location: United States
 Online Status: Offline
 Posts: 5
 | 
          Hi,
           | Posted: 23 February 2012 at 2:03pm | IP Logged |   |  
           | 
 |  
 We are using BeginDownloadEnvelopes on a folder that contains 33,000 messages. Obviously this is hugely memory intensive.
 
 I am experimenting with a loop that calls the BeginDownloadEntireMessage followed by SourceEnvelopes = EndDownloadEntireMessage in 1,000 message chunks. At the end of each loop cycle I am calling SourceEnvelopes.Clear() and setting the BeginDownloadEntireMessage object = nothing.
 
 The loop works great but the memory usage of the application (as shown in Task Manager) keeps climbing until everything eventually crashes. I am even calling GC.Collect() AND disconnecting/reconnecting at the end of each loop cycle with no reduction in memory.
 
 Is there any way to release memory resources?
 
 Thanks!
 
 Richard
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          "BeginDownloadEntireMessage object = nothing." what object are you talking about? I'd set SourceEnvelopes=Nothing and then GC.Collect.
           | Posted: 25 February 2012 at 2:58am | IP Logged |   |  
           | 
 |  
 BTW, there is no need to reconnect for each loop (unless your processing of 1000 emails takes too long to keep the connection open).
 
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  |