Examples of Debugging and Monitoring Your Service

When monitoring your application, you need to understand what issues to look for and how to look for them. The following examples describe issues that many applications face, including what to look for and how to debug them.

In Example 13-1, I have provided sample code from a Windows application I wrote to demonstrate using Task Manager and Visual Studio 2008 to create, debug, and validate both memory- and CPU-related performance and application issues.

Example 13-1. Windows application CPU and memory sample code for debugging demonstration.

Imports System.Threading Imports System.Net.Sockets Public Class MemoryAndCPU Private m_CPUThread As Thread = Nothing Private m_ThreadsThread As Thread = Nothing ...

Get Programming Windows® Services with Microsoft® Visual Basic® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.