且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用MailKit下载大量附件时出现System.OutOfMemoryException

更新时间:2023-10-06 10:01:10

问题是您在List中保留了数百条消息.

The problem is that you are keeping hundreds of messages in a List.

解决方案:不要那样.

为什么您完全需要readyMessages列表?您只能访问列表中的最后一个元素(这是最近下载的消息).

Why do you need the readyMessages list at all? You only ever access the last element in the list (which is the most recently downloaded message).