Introduction
Windows Performance Counters provide real-time metrics for CPU, memory, disk, network, and application performance. When the counter registry becomes corrupted, Performance Monitor (perfmon.exe) shows blank graphs, N/A values, or the counters are entirely missing from the Add Counters dialog. This affects not only the GUI tool but also any monitoring system (SCOM, PRTG, Prometheus Windows exporter) that relies on performance counter data.
Symptoms
- Performance Monitor shows blank or gray graphs with no data
- Add Counters dialog shows empty categories or
No instances typeperf "\Processor(_Total)\% Processor Time"returnsNo valid counters- Monitoring agents report
counter not founderrors lodctr /Qshows corrupted or missing counter strings
Common Causes
- Registry keys under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflibcorrupted - Application installation or uninstallation damaged shared counter entries
- Windows Update modified system components without updating counter registry
- Third-party monitoring tools registering and then unregistering counters incorrectly
- Disk errors corrupting the
PERFOS.INIorPERFC.INIfiles
Step-by-Step Fix
- 1.Diagnose counter corruption:
- 2.```cmd
- 3.lodctr /Q
- 4.REM Check for errors in the output
- 5.REM Also check:
- 6.typeperf -qx 2>&1 | findstr /C:"Error"
- 7.
` - 8.Rebuild performance counters from scratch:
- 9.```cmd
- 10.REM Run as Administrator
- 11.cd C:\Windows\System32
- 12.lodctr /R
- 13.REM This rebuilds the counter registry from system files
- 14.
` - 15.Resync with WMI if WMI-based monitoring is affected:
- 16.```cmd
- 17.cd C:\Windows\System32\wbem
- 18.winmgmt /resyncperf
- 19.
` - 20.Rebuild specific counters if only some are broken:
- 21.```cmd
- 22.REM Rebuild ASP.NET counters
- 23.cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
- 24.aspnet_perf.ini
- 25.lodctr aspnet_perf.ini
REM Rebuild .NET Framework counters lodctr C:\Windows\Microsoft.NET\Framework64\v4.0.30319\corperfmonsymbols.ini ```
- 1.Restart the Performance Logs and Alerts service:
- 2.```powershell
- 3.Restart-Service pla
- 4.# Restart any monitoring agents
- 5.Restart-Service Winmgmt
- 6.
` - 7.Verify counters are working:
- 8.```cmd
- 9.typeperf "\Processor(_Total)\% Processor Time" -sc 3
- 10.REM Should show three samples of CPU usage
- 11.lodctr /Q
- 12.REM Should show all counters properly registered
- 13.
`
Prevention
- Include performance counter health checks in server validation scripts
- Test monitoring tools after major Windows Updates or application installations
- Back up the Perflib registry key before installing software that registers counters
- Use
lodctr /S:backup.inito export counter configuration before changes - Monitor for counter failures in your monitoring system's own health status