0

我们必须处理应用程序中的泄漏。

我们正在我们的应用程序中测试一些查看器进行大约 200 个打开和关闭,发现句柄数约为 200。

对于同一个查看器,内存使用量是恒定的,GDI 计数也是恒定的。

问题是句柄每次都在增加,但不是恒定的。有时增加 5,有时增加 1,有时减少。我们无法看到 GDI 泄漏的持续增加。

我们已经取消订阅了应用程序中注册的所有事件,并且还释放了应用程序中使用的所有控件。在应用程序中也存在一些内存泄漏之前。现在处理所有控件后,它保持不变。

那么在这种情况下,我们还需要检查什么。我们并不感到困惑,因为内存/GDI 计数是恒定的,而句柄只会增加。

任何建议表示赞赏。

4

1 回答 1

1

Use a tool like Process Explorer to examine the handles your process has open. Select your process from the list and go to View > Lower Pane View > Handles. By default, the lower pane shows only the named handles. You can go to View > Show Unnamed Handles and Mappings to show them all.

于 2013-07-26T05:23:01.687 回答