我正在开发一个 Outlook 插件,它使用本地计算机和 Active Directory 中的 Outlook 联系人来创建特殊类型的会议请求。该程序正在通过 SaaS XML 服务与外部服务器进行通信。
SaaS 服务正在进一步利用这些联系人。特别会议的联系人是一个或多个现有 Outlook 联系人的组合,并且通过自动预填充功能直接从内存中读取它们。
我的问题:用于快速预填充的联系人组合保存在程序内存中,拥有许多联系人的人似乎在 Outlook 上消耗了大量内存。您可以想象,当一个联系人可以有多种组合并且所有组合都一一单独保存时,将一个联系人的所有组合都保存在程序存储器中。
非常欢迎任何开箱即用的解决方案!
I am developing an Outlook Add-in that is using Outlook contacts from local machine and Active Directory to create a special kind of meeting requests. The program is communicating with an external server with a SaaS XML service.
The SaaS service is further making use of the contacts. Contacts to the special meeting are combinations of one or more existing Outlook contacts and they're read with automatic prefilling functionality directly from memory.
My problem: Combinations of the contacts for the fast prefilling are saved on the program memory and people having many contacts appear to having huge memory consuming on their Outlooks. You can imagine saving all combinations of one's contacts on the program memory when one contact can have several combinations and all of them are saved separately one by one.
Any out of the box solutions are greatly welcome!
发布评论
评论(1)
听起来您可能正在尝试加载电子邮件地址的整个 Active Directory 对象。如果是这种情况,您可以将 DirectoryEntry 中返回的内容限制为仅必要的字段。这将大大减少内存占用。
除此之外,您可能需要考虑使用内存映射文件来提高性能:
http://blogs.msdn.com/b/salvapatuel/archive/2009/06/08/working-with-memory-mapped-files-in-net-4.aspx
It sounds like you might be attempting to load the entire Active Directory object for the email address. If that is the case, you can limit what you return in your DirectoryEntry to only the necessary fields. This will greatly reduce the memory footprint.
Beyond this, you might want to look at using Memory Mapped files to improve your performance:
http://blogs.msdn.com/b/salvapatuel/archive/2009/06/08/working-with-memory-mapped-files-in-net-4.aspx