Internet Explorer and Memory
From: Richard Bell (rbell01824_at_earthlink.net)
Date: 08/04/04
- Next message: Al Dunbar [MS-MVP]: "Re: Script for your enjoyment"
- Previous message: Mythran: "Re: Deleting a directory with files and subfolders"
- Next in thread: Viatcheslav V. Vassiliev: "Re: Internet Explorer and Memory"
- Reply: Viatcheslav V. Vassiliev: "Re: Internet Explorer and Memory"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 04 Aug 2004 23:29:09 GMT
I'm using VBSCRIPT to automate Internet Explorer and repeatedly
navibate to a set of several hundred web pages. Over time the system
is running slower and slower. Investigation shows that memory is
gradually decreasing per perfmon memory KB available. Examination
with windows task manager shows several copies of iexplorer (one for
each pass). It appears that I'm not properly closing and releasing
iexplorer and that it remains in the task list, draining memory and
slowing the system down.
I start and stop IE with the following code in a vbs that is executed
by a shell.run command.
Several questions:
Do I need to do something besides g_oIE.Quit to actually terminate IE
and get it removed from the process list?
Since the g_oIE.Quit is in its own vbs, shouldn't its termination
release all of its resources? If not, what do I need to do to force
the resources to release?
Thanks for any clues.
===================================================================
' code to start/stop IE
Sub IEStart()
On Error Resume Next
Set g_oIE =
WScript.CreateObject("InternetExplorer.Application", "g_oIE_")
g_oIE.Visible = True ' make
visible on the screen
if err.number <> 0 then
Out( "InternalErrorIEStart1," & Err.number & "," &
Err.Description & "," & Err.Source )
err.Clear
end if
WScript.Sleep 2000 ' give
IE a chance to start
'Do While (g_oIE.Busy):Loop ' Important:
wait till MSIE is ready
g_boIE = true ' ie
is up and ready
if err.number <> 0 then
Out( "InternalErrorIEStart2," & Err.number & "," &
Err.Description & "," & Err.Source )
err.Clear
end if
On Error Goto 0
End Sub
Sub IEStop()
if g_oIE.Busy then ' stop IE
g_oIE.Stop
end if
if err.number <> 0 then
Out( "InternalErrorIEStop1," & Err.number & "," &
Err.Description & "," & Err.Source )
err.Clear
end if
' Do While (g_oIE.busy):Loop
WScript.Sleep 2000 ' give IE a chance to start
g_oIE.Quit
Set g_oIE = Nothing
Out( "IEQuit" )
if err.number <> 0 then
Out( "InternalErrorIEStop2," & Err.number & "," &
Err.Description & "," & Err.Source )
err.Clear
end if
On Error Goto 0
End Sub
- Next message: Al Dunbar [MS-MVP]: "Re: Script for your enjoyment"
- Previous message: Mythran: "Re: Deleting a directory with files and subfolders"
- Next in thread: Viatcheslav V. Vassiliev: "Re: Internet Explorer and Memory"
- Reply: Viatcheslav V. Vassiliev: "Re: Internet Explorer and Memory"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|