rocky050371
asked on
Windows Service (Memory and Error Handling)
I have a windows service that triggers every minute, it uses IIS for the remote object calls, all on one machine at the moment. The service runs fine for hours but then appears to stop despite showing as running in services.
My questions are should I be forcing garbage collection on the objects? What type of error handling is best here? Is there a global error handler I can assign to the service?
Any help would be appreciated
My questions are should I be forcing garbage collection on the objects? What type of error handling is best here? Is there a global error handler I can assign to the service?
Any help would be appreciated
Show us some code. What is the service doing?
ASKER
I cant really display any other code
Dim props As New Collections.Specialized.ListDictionary()
props.Add("UseDefaultCredentials", True)
_channel = New HttpChannel(props, New SoapClientFormatterSinkProvider(), New SoapServerFormatterSinkProvider())
ChannelServices.RegisterChannel(_channel, False)
If Not EventLog.Exists(EVENTLOGNAME) Then
EventLog.CreateEventSource(EVENTLOGNAME, EVENTLOGNAME)
End If
_timer = New Timer
_timer.Interval = CType(ConfigurationManager.AppSettings("poll_Duration"), Double)
_timer.Enabled = True
AddHandler _timer.Elapsed, AddressOf _timer_Tick
EventLog.WriteEntry(EVENTLOGNAME, "Scheduler Started", EventLogEntryType.Information)
Private Sub _timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
SyncLock Me
EventLog.WriteEntry(EVENTLOGNAME, "", EventLogEntryType.Information)
CheckStack()
End SyncLock
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.