• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1464
  • Last Modified:

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
0
CoolMagic
Asked:
CoolMagic
1 Solution
 
BrianGEFF719Commented:
Yes a memory leak is present...please see:

http://support.microsoft.com/default.aspx?scid=kb;en-us;893629
0
 
nffvrxqgrcfqvvcCommented:
Internet explorer always runs around those numbers. If you have ever looked at the process "iexplorer.exe" you will see the memory usage is the same being around 15-25
0
 
CoolMagicAuthor Commented:
OK guys,I think egl1044 has right.Thank you!
0
 
BrianGEFF719Commented:
CoolMagic, I'm glad you resolved your issue! But, I would still suggest you read the article I posted.


Good Luck
-Brian
0
 
JPMC_SITCommented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now