WPF性能问题 [英] WPF Performance issue

查看:130
本文介绍了WPF性能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,

我已经使用C#在WPF中开发了一个应用程序.该应用程序包括第三方dll,用于在特定窗口中显示摄像机.

通常,应用程序在没有相机对象(非托管对象)的情况下占用90 MB-135 MB的内存.即我删除了设计和代码页中所有重新绑定相机对象的代码(xaml和xaml.cs).内存增加并停止在一个最大值.

如果我在应用程序中使用相机对象,则内存会逐渐增加.每次打开相机窗口时,内存将逐渐增加,例如135 MB 141 MB,143 MB ....

我在所有必要的地方都使用了 GC.Collect Using 语句来清除托管内存.我无法减少或停止增加内存.

如何解决这个问题?

任何建议将不胜感激

预先感谢.

Hi Friends,

I have developed an application in WPF with C#. The application includes a third party dll for displaying the camera in a particular window.

Normally the application takes the memory 90 MB - 135 MB without camera object (Unmanaged object). i.e I removed all the code reagrding the camera object in the design and code page (xaml and xaml.cs). The memory increasing and stops at one max value.

If I use the camera object in the application, the memory is increasing gradually. When I open the camera window every time, the memory will be increased gradually like 135 MB 141 MB, 143 MB....

I have used GC.Collect and the Using statement for all necessary place to clear the managed memory. I am not able to reduce or stop the memory increasing.

How to solve this issue?

Any suggestions will appreciate

Thanks in advance.

推荐答案

很明显,您使用的第三方组件中存在内存泄漏.
我建议您与他们联系并让他们调查此事,因为我们在这里为您做的很少.

话虽如此,请尝试使用内存探查器查看内存泄漏的确切位置,这也可能对您有所帮助.
Obviously there is a memory leak in the third party component you are using.

I would suggest you contact them and have them look into the matter, as there is very little we can do for you here.

Having said that try using a memory profiler to see where exactly you are leaking memory, that could help you also.


这篇关于WPF性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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