I wonder if someone can have a look at my code and tell me if there is a possible memory leak. You can download the VS 2003 project from here: ftp://accdata1.eurosql.com/ReplicationStatus.zip
Basically, when the app is started it uses approx 1.6MB of memory, during a short period, say about 10 minutes, the useage seems to settle around 25MB!
A little background on what the app does...
The application is a taskbar app and has a very small windows form, which when opened, shows the status of a clients SQL Server pull subscription. The taskbar icon has different states depending on the status of the pull subscription, which is updated every 5 seconds. The status on the windows form itself is not updated, until the user selects to show the windows form.
Below is the timer code which fires-off this status update request. If I disabled this timer, the app memory stays at 1.6MB, so obviously it's what the sub CheckClientStatus() is doing that is the problem, but I haven't managed to work out what that is.
Have a look at the ReplStatus.vb form and code and look for the following timer and below this the culprit sub CheckClientStatus()
Private Sub myTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles myTimer.Tick
myTimer.Interval = CInt(RefreshInterval.Text)
myTimer.Enabled = False
myTimer.Enabled = True
I'm sure this is a clean-up problem, but I cannot see what I can do to my code to fix this. Interestingly, when I select from the the taskbar icon to open the small windows form, to see a full description of the status, upon clicking "OK" which minimises and hides the form, the memory useage then drops back down to 1.6MB. Obviously .NET is finally doing it's own clean-up processes, but this is the only time this will happen.
The reason for the 500 points is more for urgency. ;)