I made a load test harness for a site and at given intervals it fires this method. For some reason, the two WebBrowser.Navigate methods in the centre cause a huge memory leak. I'm setting them to nothing and calling the garbage collector in the Finally block but it makes no difference.
With the two Navigate lines commented out, no memory leak.
Are there issues with the WebBrowser object? Do they require flushing somehow before garbage collection, or have I just completely missed something?
With the two Navigate lines commented out, no memory leak.
Are there issues with the WebBrowser object? Do they require flushing somehow before garbage collection, or have I just completely missed something?

Code:
Private Sub TimerWB_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TimerWB.Tick
Dim strManufacturerCollectionPage As String
Dim strProductCollectionPage As String
Dim nPos1 As Integer, nPos2 As Integer
wbManCollection = New WebBrowser
wbProductCollection = New WebBrowser
Try
nPos1 = mWebCount Mod mAL_WebTest1.Count
nPos2 = mWebCount Mod mAL_WebTest2.Count
strManufacturerCollectionPage = mAL_WebTest1.Item(nPos1)
strProductCollectionPage = mAL_WebTest2.Item(nPos2)
' *** This is the manufacturers web request
wbManCollection.Navigate(strManufacturerCollectionPage)
' *** This is the product collection web request
wbProductCollection.Navigate(strProductCollectionPage)
ShowWebFeedback("Iteration number: " & mWebCount)
mWebCount = mWebCount + 1
' Update the Req/Sec rating
UpdateWPReqSec()
Catch ex As Exception
cLog.logException(ex)
Finally
strManufacturerCollectionPage = Nothing
strProductCollectionPage = Nothing
nPos1 = Nothing
nPos2 = Nothing
wbManCollection = Nothing
wbProductCollection = Nothing
GC.WaitForPendingFinalizers()
GC.Collect()
End Try
End Sub