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
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Show us some code. What is the service doing?
rocky050371Author Commented:
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)

        End SyncLock

    End Sub

Open in new window

Only thing I can say is add exception handling and make sure you release resources that you don't need.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.