|
-
Mar 18th, 2011, 08:29 PM
#3
Fanatic Member
Re: webbrowser control - memory leak
Any help...well I used webbrowsers in threads once and they were accessed and created using delegated subs. (Thread asked for the Main form to invoke some subroutine). It also got increasingly slower after a while, and the RAM memory kept on increasing.
Then I started to discover that any created webbrowser instance wasn't disposed from memory when it got out of focus. So, I had to dispose every control after I used it. (another invoke).
You might have to create a new webbrowser control, make it process the navigation event (AddHandler mytempbrowser.navigating, AddressOf <subname>) and finally dispose this webbrowser.
I do not believe you are creating multiple instances, but maybe the old data doesn't get disposed when navigating? I'd say...try to dispose some. 
Besides the webbrowser, I see you are calling the "CreateObject("WScript.Shell")" quite often. Be careful with "in-code variable creation", they usually remain after the loop ended.
Add all above the loop this line:
Code:
Dim shell As Object = CreateObject("WScript.Shell")
And call it like this:
Code:
shell.sendkeys("{ENTER}")
shell.Popup("Hello", 3, "hello!!")
etc.
Is there no way to use an HTTP web request instead of a webbrowser? A webbrowser stores all page images and objects, pure HTML would take up very little compared to that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|