Fix high cpu usage caused by diagnostic policy service


  1. Posts : 6
    Windows 10
       #1

    Fix high cpu usage caused by diagnostic policy service


    Hello,

    as mentioned in another thread reply I found a solution by someone for this common problem with high cpu usage by a windows service. In the folder "C:\Windows\system32\sru" are constantly created log files and the directory becomes very large over time. Then I stopped the service, I even needed to force kill the process via taskmanager because the service was too busy The service is part of the svchost process structure so you first need to find the corresponding PID of process. It is much safer via cmd and then "sc stop dps". Then you can delete the whole folder C:\Windows\system32\sru. When you start the service afterwards the folder stays empty or even gone. For me it did not affect the service, troubleshooting does still work and cpu usage is now low

    I attached a Batch which finds the pid of the dps service and stops the service. The it promps the user to delete the folder "sru" and starts the service after that.

    You can also use the code below and paste it in a new text file. Then rename suffix from *.txt to *.bat and run with admin privileges.

    Code:
    @echo off
    echo ... Set DPS service start type to manual ...
    echo.
    sc config DPS start= demand
    
    echo.
    echo ... Find PID of DPS service ...
    
    for /f "tokens=2 delims=[:]" %%f in ('sc queryex dps ^|find /i "PID"') do set PID=%%f
    
    echo.
    echo ... Kill DPS service
    echo.
    
    taskkill /f /pid %PID%
    
    
    echo.
    echo ... Delete sru Folder ...
    echo.
    
    rd /s "%windir%\system32\sru"
    
    echo.
    echo ... Set DPS service start type to auto ...
    echo.
    sc config DPS start= auto
    
    echo.
    echo ... Start DPS service ...
    
    sc start DPS
    echo.
    
    pause
    Fix high cpu usage caused by diagnostic policy service Attached Files
      My Computer


  2. Posts : 773
    Windows 10 Home x64 - Version 21H2 (OS Build 19044.2006)
       #2

    At what percentage of the CPU being used would you recommend executing the batch file? I looked at the "sru" folder on my system, and it was 11MB in size.


    It is curious that you mentioned that the folder may not regenerate or even fill up again with files. To me, that doesn't seem right for a System32 folder and seems like an integrity violation to the system.


    I wonder what the long term effects of executing the batch file on this service would be?
    Last edited by EyeInTheSky; 25 Jun 2018 at 08:16. Reason: Correction
      My Computer


  3. Posts : 6
    Windows 10
    Thread Starter
       #3

    EyeInTheSky said:
    At what percentage of the CPU being used would you recommend executing the batch file? I looked at the "sru" folder on my system, and it was 11MB in size.


    It is curious that you mentioned that the folder may not regenerate or even fill up again with files. To me, that doesn't seem right for a System32 folder and seems like an integrity violation to the system.


    I wonder what the long term effects of executing the batch file on this service would be?
    The size of the folder does not really matter, I had sometimes just small files always created again and again, like in a loop. And cpu usage can vary, my laptop has only 2 cores and is an ULV processor, so 30 percent did really affect perfomance and caused heat. I dont think that there are any downsides because even disabling the service has no affect on functionality either. Troubleshooting still works with service disabled, only wlan troubleshooting does not work without this service.

    Here whats happening when service is disabled
    Fix high cpu usage caused by diagnostic policy service-unbenannt.png
    My bat file only stops the service and asks the user to delete the problematic folder. Then the service is started again. I donīt know how widespread this problem is, on laptops it can be very resource hogging. Even microsoft itself admits this solution, and proposes to rename a relevant file in this folder (besides the log files). My approach is to simply delete the whole folder. It is similar to deleting the "software distribution" folder from windows udpate service. The service can create the folder if needed (in my case the folder sru never appeared again). IMHO there are no important files in this folder.

    CPU usage most of the time of service
    Fix high cpu usage caused by diagnostic policy service-unbenannt.png
      My Computer


  4. Posts : 773
    Windows 10 Home x64 - Version 21H2 (OS Build 19044.2006)
       #4

    Thanks for the in-depth feedback. It is always appreciated. I have a second computer not listed in "My Computer" and it just so happens to be a laptop. I'll have to look at its CPU usage to see if this nifty little .bat file can help if it is needed.


    Thanks again!
      My Computer


  5. Posts : 1
    Windows 10
       #5

    I had the same problem, CPU usage from this service around 10-15%, disk writes about 5MB / s. I've tried everything, pulling out the components, installing the clean up-to-date Windows 10 Pro 1903 ... without result. Update BIOS, Drivers ... Nothing.
    Do you know what the problem was? To avoid having to turn on the computer, I used a USB to PS / 2 adapter. Problems disappeared after the pulling out this adapter...Look on my profile for system configuration, i described it in detail...Fix high cpu usage caused by diagnostic policy service-img_7975.jpg
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Đ Designer Media Ltd
All times are GMT -5. The time now is 08:36.
Find Us




Windows 10 Forums