WebBrowser control - memory leak,or?

Posted on 2006-05-01
Last Modified: 2009-12-17

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,
Question by:CoolMagic
    LVL 19

    Expert Comment

    Yes a memory leak is present...please see:;en-us;893629
    LVL 29

    Accepted Solution

    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

    Author Comment

    OK guys,I think egl1044 has right.Thank you!
    LVL 19

    Expert Comment

    CoolMagic, I'm glad you resolved your issue! But, I would still suggest you read the article I posted.

    Good Luck

    Expert Comment

    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:
       I use:

    It works for me, anyway

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now