I am fairly new to VB.NET and I am working with an service that implements a timer. The timer action will do some work and then log success/failures to the event log. I am noticing that each time the event log is written to the memory usage of the executable shown in the task manager increases. It does not increase by much, maybe 20k or so. Is this expected? The code below is an example of what I am doing that is causing the memory to increase.

Thank you very much in advance,

Module Module1
    Sub Main()
		Dim Timer1 As Timer = New Timer(1000)
        AddHandler Timer1.Elapsed, AddressOf Timer1_Action
        Timer1.Enabled = True
    End Sub
    Sub Timer1_action(ByVal source As Object, ByVal e As ElapsedEventArgs)
		Console.WriteLine("Timer Fired")
		EventLog.WriteEntry("Application", "Action Triggered", EventLogEntryType.Information) 
    End Sub
End Module
7 Years
Discussion Span
Last Post by JJCollins

Well if it is writing to the log on every successful / unsuccessful action then an increase in memory usage can be expected.

- Jordan

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.