CoolMagic
asked on
WebBrowser control - memory leak,or?
Hello,
I have problems using WebBrowser control (mshtml) from my Visual Basic application.
It seems to have a large memory usage,and I don't know what can be done about that.
When I run my program,which uses WebBrowser control,and browse a few pages,memory usage goes to about 20 MBs.
And it grows rapidly.
When I shut down my program,and run it again,the memory usage is almost the same.Seems like everything remains in memory,even if I closed my program.
I have heard that this is a "false" number,that it is not a real memory usage.Is it true?
I searched for a solution on the internet,and saw that other people has the same problem,but I was unable to find a wokring solution.
Does anyone knows ANYTHING about this?
Thank you very much,
Goran
I have problems using WebBrowser control (mshtml) from my Visual Basic application.
It seems to have a large memory usage,and I don't know what can be done about that.
When I run my program,which uses WebBrowser control,and browse a few pages,memory usage goes to about 20 MBs.
And it grows rapidly.
When I shut down my program,and run it again,the memory usage is almost the same.Seems like everything remains in memory,even if I closed my program.
I have heard that this is a "false" number,that it is not a real memory usage.Is it true?
I searched for a solution on the internet,and saw that other people has the same problem,but I was unable to find a wokring solution.
Does anyone knows ANYTHING about this?
Thank you very much,
Goran
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK guys,I think egl1044 has right.Thank you!
CoolMagic, I'm glad you resolved your issue! But, I would still suggest you read the article I posted.
Good Luck
-Brian
Good Luck
-Brian
SOLUTION! I've battled this problem for what seems like years. Microsoft's webrowser object lacks vital things like cache and history control. My work-around is simple... Rather than navigating to a new page and adding it to the stack (and memory), I use javascript's "replace" function that replaces the current page rather than adding a new one. For my automation systems, this works great!
So, instead of:
Me.Webrowser1.Navigate("http://url")
I use:
Me.Webrowser1.Navigate("ja vascript:w indow.loca tion.repla ce('http://url');")
It works for me, anyway
So, instead of:
Me.Webrowser1.Navigate("http://url")
I use:
Me.Webrowser1.Navigate("ja
It works for me, anyway
http://support.microsoft.com/default.aspx?scid=kb;en-us;893629