Hey I have this console application, which needs to run over longer periods of time, one of it functions is to detect a certain process, but it's leaking on that part.
I'm using this in a timer for the detection:
Private Sub OnTimedEvent() Handles mytimer.Elapsed
If Process.GetProcessesByName(Gname).Length = 1 Then
misRunning = True
Else
misRunning = False
End If
End Sub
GC.Collect would help, but I'm not certain that calling GC.Collect is the right approach.