内存分析Outlook外接程序如何?提高性能,寻找挂机等 [英] Memory Profiling Outlook Add-ins how to? Increasing performance, Finding hang-ups etc

查看:101
本文介绍了内存分析Outlook外接程序如何?提高性能,寻找挂机等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我编写了一个复杂的outlook加载项,它占用了大量的内存,因为它的使用越多,直到outlook停止响应。该加载项主要对日历进行了大量搜索。

我想知道如何运行加载项的内存配置文件以显示挂起的位置以及不存在的对象被收集的等等,以便我可以更快。我在网上看到了一些内存分析器,但似乎没有一个可以满足outlook外接程序。任何帮助将不胜感激。

Visual Studio 2008专业版C#
Outlook 2007

感谢您的时间。

Hi,

I have written a complex outlook add-in which is taking up alot of memory the more its used until outlook just stops responding. The add-in primarily does alot of searches of the Calendar.

I was wondering how I can run a memory profile of the add-in to show me where the hang ups are and what objects are not being garbaged collected etc so that I can make it quicker. I have seen some memory profilers online but none that seem to cater to outlook add-ins. Any help would be greatly appreciated.

Visual Studio 2008 Professional
C#
Outlook 2007

Thank you for your time.

推荐答案

从概要分析的角度来看,VSTO Add In与任何其他托管应用程序一样。在下面的两个线程中,将更详细地讨论内存泄漏。

http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/647c803c-3cb9-4250-8641-ded48e4b158c/

http://social.msdn.microsoft .com /论坛/ zh-CN / vsto / thread / 7b2acfee-dd73-4b0c-9ddd-71248ec2dff8

您需要分析代码以查找可能的内存泄漏情况,请查看您的位置引用一个互操作对象(即使你通过VSTO对象模型得到它),你正在处理它并将引用设置为null。
你可能想要创建一个包装类来获取日历中常用的对象喜欢预约并妥善处理。

谢谢,iii Navneet

A VSTO Add In is just as any other managed application from the point of view of profiling. In below two threads memory leaks are discussed in more details.

http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/647c803c-3cb9-4250-8641-ded48e4b158c/

http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/7b2acfee-dd73-4b0c-9ddd-71248ec2dff8

You need to analyze your code for possible memory leak scenarios, see where ever you refer a interop object (even if you got it through VSTO object model) you are disposing it and setting the reference to null.

You may want to create a wrapper class which gets the frequently used objects in calendar like appointment and disposes them properly.

Thanks,
Navneet


这篇关于内存分析Outlook外接程序如何?提高性能,寻找挂机等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆