通过COMCTL32.DLL过多的内存使用量时,CheckBox控件的Visible为真控件、使用量、内存、DLL

由网友(陪我到地狱流浪)分享简介:我将控件添加到Windows窗体运行时在C#.NET应用程序中。每个这些控件交互的特定信号,并使用一些数据从该信号 - 信号名称,描述,源,单位,值等I am adding controls to a Windows Form during runtime in a C# .NET application. Each...

我将控件添加到Windows窗体运行时在C#.NET应用程序中。每个这些控件交互的特定信号,并使用一些数据从该信号 - 信号名称,描述,源,单位,值等

I am adding controls to a Windows Form during runtime in a C# .NET application. Each of these controls interacts with a particular signal and uses some data from that signal -- signal name, description, source, units, value, etc.

这些管制对他们的复选框。如果只是这些信号中的一个复选框的Visible属性为真,我的应用程序的提交内存跃过800MB。没有任何其他数百个信号有问题。

These controls have a check box on them. When the Visible property of the checkbox of just one of these signals becomes true, my application's Committed memory jumps over 800MB. None of the other hundreds of signals have the problem.

我用的工具DebugDiag资料得知COMCTL32.DLL被分配805.45兆字节。特别是:

I used the DebugDiag tool to learn that comctl32.dll is allocating 805.45 MBytes. In particular:

在功能c​​omctl32_72380000!CCHeapAllocArraySize + 3A 分配类型堆分配(S) 在堆处理0xf37893cd 分配次数1分配(S) 分配大小803.20兆字节 在泄漏概率16%

应该是什么我的下一个故障排除步骤?什么工具可以帮助?

What should be my next troubleshooting steps? What tools can help?

更新: 我找到了问题的家长控制System.Windows.Forms.TrackBar。轨道酒吧的最大超过200,000,000。当我的最大下降100,000,000,它使用了大约一半的存储器。设置最大围绕百万使用的内存更合理的数量。

Update: I tracked the problem to a System.Windows.Forms.TrackBar on the parent control. The track bar had a maximum over 200,000,000. When I decreased the maximum to 100,000,000, it used about half the memory. Setting the maximum around 1,000,000 used a more reasonable amount of memory.

推荐答案

我找到了问题的家长控制System.Windows.Forms.TrackBar。轨道酒吧的最大超过200,000,000。当我的最大下降100,000,000,它使用了大约一半的存储器。设置最大围绕百万使用的内存更合理的数量。

I tracked the problem to a System.Windows.Forms.TrackBar on the parent control. The track bar had a maximum over 200,000,000. When I decreased the maximum to 100,000,000, it used about half the memory. Setting the maximum around 1,000,000 used a more reasonable amount of memory.

在checkbox.Visible扔我。看来,应用程序被创建控制和在点checkbox.Visible成为真正的内存,但该复选框本身无关的问题。

The checkbox.Visible threw me off. It appears that the applications was creating the control and the memory for it at the point the checkbox.Visible became true, but the checkbox itself had nothing to do with the problem.

阅读全文

相关推荐

最新文章