You can use the RemoveInstance method to remove an instance of a custom performance counter. You might delete an instance if you have created a counter instance associated with an application and you are removing that application from the system. For example, if you have an order entry application that creates counters in an OrderProcessing category’s Total instance, you would delete that instance as part of uninstalling your application.
You cannot remove instances from the performance counters that are part of Windows. If your PerformanceCounter component does not refer to a valid instance, this method will throw an exception.
To remove a performance counter instance
The following example shows how to remove an instance called Reference from a counter called BookOrders:
[Visual Basic] PerformanceCounter1.InstanceName = "Total" PerformanceCounter1.RemoveInstance [C#] PerformanceCounter1.InstanceName = "Reference"; PerformanceCounter1.RemoveInstance();
Creating PerformanceCounter Components | Category and Counter Management