Winform内存问题 [英] Winform Memory Problem
问题描述
我有一个C#winform应用程序.有一个屏幕,其中包含许多Infragistic控件(大约30个文本框).当我打开相同的表单大约30次(即30个相同表单的实例)后,应用程序退出.没有显示错误.我不是 非常确定如何进行诊断.我安装了Redgate Memory Profiler来查看发生了什么.我可以看到NativeWindows + HandleBucket的大小有所增加,尽管考虑到它的大小我无法推断出多少 第一次使用此工具.
I have a C# winform application. Have one screen which has quite a few Infragistic controls (about 30 textboxes). After I open the same form about 30 times i.e 30 instances of the same form, the application just exits out. No error is shown. I am not quite sure how to go about diagnosing this. I installed Redgate Memory Profiler to see what was happening. I could see the NativeWindows+HandleBucket to be increasing quite a bit in terms of size though I was not able to infer much considering its my first time with this tool.
如果有人可以给我一些探索者的建议或指导,我将不胜感激.目前,我只是在迷宫中徘徊,无法弄清楚该怎么做.
Would appreciate if someone could throw some pointers or directions for me to explorer. Currently I am just going around a maze unable to figure out how to go about it.
谢谢
Sai
推荐答案
为什么您要打开这么多实例?
why do you open so many instances of this form?
该错误可能是WindowHandles数量存在问题.我不知道是否抛出了异常(也许是System.ComponentModel.Win32Exception),您可以处理,但是您可以尝试...
The error might be an issue with the number of WindowHandles. I don't know, if there is an exception (maybe System.ComponentModel.Win32Exception) thrown, that you could handle, but you can try...
我建议对您的表单实施分页,这意味着一次只显示全部数据的一部分.
I'd recomment to implement paging to your form, means display just a part of the whole amount of data at a time.
此致
Thorsten
Thorsten
这篇关于Winform内存问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!