Link to home
Start Free TrialLog in
Avatar of CoolMagic
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
Avatar of BrianGEFF719
BrianGEFF719
Flag of United States of America image

Yes a memory leak is present...please see:

http://support.microsoft.com/default.aspx?scid=kb;en-us;893629
ASKER CERTIFIED SOLUTION
Avatar of nffvrxqgrcfqvvc
nffvrxqgrcfqvvc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CoolMagic
CoolMagic

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
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("javascript:window.location.replace('http://url');")

It works for me, anyway