1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Webbrowser.dispose taking more CPU

Discussion in 'Visual Basic .NET' started by easy2earn, Sep 23, 2013.

  1. easy2earn

    easy2earn Regular Member

    Joined:
    Jun 5, 2013
    Messages:
    293
    Likes Received:
    57
    Occupation:
    IT
    I am in a process of developing windows application/bot,where I can open a new form and then a webbrowser, execute tasks and close the webbrowser as well as form
    webbrowser.dispose taking too much of CPU and System crashes after loop of 100 times
    I want to repeat the process for 300+ time


    My requirement is to close the webbrowser and release it from memory each time before form closes.

    Any help is highly appreciated, as I am new to windows programming and struck up with this for the last 2 days and google search results are more confusing.
     
  2. botrockets

    botrockets Regular Member

    Joined:
    Mar 16, 2013
    Messages:
    272
    Likes Received:
    463
    Occupation:
    Software Developer
    Location:
    Saint T.N.
    can you show us the code so we can figure out what's wrong..
     
  3. sm754

    sm754 Registered Member

    Joined:
    Mar 21, 2012
    Messages:
    93
    Likes Received:
    38
    Occupation:
    Farmer
    Location:
    Azerbaijan
    You might have addons/extensions for IE loading (which in turn create massive memory leaks).
    If those are present, try uninstalling them.
     
  4. 00110011

    00110011 BANNED BANNED

    Joined:
    Jun 5, 2013
    Messages:
    22
    Likes Received:
    22
    This won't be very fast, but after about 50 loops execute:

    Code:
    Diagnostics.System.Proccess.Start ("taskkill -f /im iexplore.exe")
     
  5. neutralhatter

    neutralhatter Jr. VIP Jr. VIP Premium Member

    Joined:
    Jun 23, 2010
    Messages:
    430
    Likes Received:
    330
    not sure if you've been able to solve it but just FYI.

    .net automatically disposes objects once they are out of the scope. Unless you are performing unmanaged code, the garbage collector should drop by to clean up your memory once you have not enough left. so, explicitely calling dispose may not be necessary.