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 progra开发者_Go百科m 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!
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
精彩评论