Hi Greg,
Thanks for jump in here.
This is a bit more complicate because the use of the BO is not in a single method, the BO instance is being created as follow:
Private WithEvents _bizDuplicateCardRecords As New bizTransactionItemsImport
Then, there is a process running in a BackGroundWorker that will call a method, that will call another method and in those methods the _bizDuplicateCardRecords BO is being used.
In the BackgroundWorker.DoWork() I have code like this:
If _bizDuplicateCardRecords IsNot Nothing Then
'-- Make sure the BO is disposed to avoid memory leak from previous use.
_bizDuplicateCardRecords.Dispose()
End If
_bizDuplicateCardRecords = New bizTransactionItemsImport
_bizDuplicateCardRecords.FillPreviousRecordLookup(Me.BizTransaction1.PK_Transaction, Me.BizTransaction1.FK_Vendor_Carrier)
Then in the other methods I use the _bizDuplicateCardRecords, but once a transaction has completed, a new instance is created and filled in the DoWork() event.
But still with all this, if I process 2 transactions the memory just keeps going up. Any other suggestion?
Edhy Rijo