IE WebBrowser控件中的内存泄漏 [英] Memory Leak in IE WebBrowser Control

查看:89
本文介绍了IE WebBrowser控件中的内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我希望这是提出这个问题的正确位置!

我最初在C#开发论坛中提出这个问题:
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=8&SiteID=1
但其中一位版主告诉我,我需要问一下它在
IE讨论组
但其中一位主持人告诉我,我需要在此问一下论坛!
这是我的问题:

这似乎是一个常见问题,但到目前为止我还没有找到任何答案。

我正在构建一个带有IE WebBrowser控件的C#应用​​程序。
每当我在一个页面中导航时,我已经加载到控件中,大量的内存被使用而不是被释放。使用7个小时后,我的应用程序显示内存使用量为900MB,这对我的客户来说简直是不可接受的。

我的问题(对于我自己和所有其他问过它的人)是:我们如何在不完全关闭应用程序的情况下释放WebBrowser控件使用的内存?我试过从它的父窗体中删除WebBrowser控件
并在其上调用dispose()方法,但是内存不会被释放。我已经确认了Taskmgr.exe,
Perfmon.exe和Process Explorer的内存泄漏/使用情况,所有这些都显示了这种异常高的内存使用情况。

我理解内存使用可能部分来自底层DOM对象中的循环引用,但我需要一种方法来不时地手动释放这个内存。

如果这是不可能的,那么开发人员有哪些替代方案
(因为我们很多人都不接受这种内存消耗)?

我真的很感激,并认为如果我们最终可以解决这个问题会很棒!非常感谢你的帮助!

再次,如果这是错误的论坛,我道歉,但我被告知,这是发布这个的地方!再次感谢!

解决方案

我所做的是产生一个自动化程序的Web浏览器,通过命令行传递id。程序根据id从数据库中读取其他请求信息,并将自动化结果写入由id标识的数据库行,然后退出。结果

Ok, I hope this is the correct place to ask this question!

I originally asked this question in the C# Development forum:
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=8&SiteID=1
but one of the moderators informed me that I needed to ask it in the
IE Discussion Group
but one of the moderators there told me that I need to ask it in THIS forum!
Here is my question:

This appears to be a common problem, but so far I have not found any answers
to it.

I am building a C# application with an IE WebBrowser control in it.
Whenever I navigate within a page I've loaded in the control, large amounts
of memory are being used and not released. After 7 hours of use, my app was
showing a memory use of 900MB, which is simply unacceptable for my clients.

My question (for myself and all the others who have asked it) is: how can we
release the memory being used by the WebBrowser control without completely
shutting down the application? I have tried removing the WebBrowser control
from it's parent form and calling the dispose() Method on it, but the memory
is not released. I have confirmed the memory leak/usage with Taskmgr.exe,
Perfmon.exe, and Process Explorer, all of which show this abnormally high
memory usage.

I understand that the memory usage might come in part from circular
references in the underlying DOM object, but I need a way to manually free
this memory from time to time.

If this is in no way possible, then what alternatives do developers have
(seeing as this memory consumption is not acceptable to many of us)?

I would really appreciate it, and think it would be great if we can finally
resolve this issue! Thank you so much for your assistance!

Again, I apologize if this is the wrong forum, but I was informed
that this was the place to post this!  Thanks again!

解决方案

What I do is to spawn off a web browser automating program, passing an id via command line. The program reads additional request information from a database based on the id and writes automating result to the database row identified by the id, then exits. 


这篇关于IE WebBrowser控件中的内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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