Link to home
Start Free TrialLog in
Avatar of rocky050371
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
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Show us some code. What is the service doing?
Avatar of rocky050371
rocky050371

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

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial