corrupted performance counters?

Nahum picture Nahum · May 28, 2012 · Viewed 9.8k times · Source

Preformance counters are EVIL. don't use them.

if(PerformanceCounterCategory.Exists("ILoveYou")  ) // is true
{
    PerformanceCounterCategory.Delete("ILoveYou"); 
    //throws exception The **configuration registry** key is invalid
}

at System.Diagnostics.PerformanceCounterLib.RegisterFiles(String arg0, Boolean unregister)
at System.Diagnostics.PerformanceCounterLib.UnregisterCategory(String categoryName)
at System.Diagnostics.PerformanceCounterCategory.Delete(String categoryName)
at WindowsFormsApplication1.Program.SetupCategory()

all I found is this: http://blogs.msdn.com/b/oanapl/archive/2009/04/24/fix-corrupted-performance-counters.aspx (Using LODCTR /R)

and it doesn't help. as i have no idea what file are they talking about. any1 got any other ideas?

PS I use windows xp SP3 may this be the problem? i understand it is suppose to support performance counters fully unless I cancel the page file.

to make this clear my problemis that im unable to UNINSTALL my counters.

Answer

CEPA picture CEPA · Jun 5, 2012

My company runs into problems with the performance counters getting corrupt regularly. If it is a problem with the actual counters being corrupt, you can check for corrupted Performance Counters by:

  1. Going to start | run | perfmon
  2. Click OK
  3. Click on the add button on the toolbar in the right panel ("+" sign button)
  4. Ensure that the proformance object drop down menu contains items and not just numbers
If the Counters are numbers or Blank:
  • Locate and Rename these 3 files in %windir%\system32:
    • Perfc009.dat
    • Perfh009.dat
    • Perfi009.dat
  • Insert the Windows XP Install CD
  • Browse to their CD drive and into the I386 Folder (i.e. D:\I386)
  • Locate those same files here
  • Copy and Paste them from the CD back into System32
  • Reboot the computer.
  • This is the best solution we have found for the issue.