Question Windows 10: Service Host Diagnostic Policy Service Memory Leak

sharp461

Distinguished
Mar 24, 2014
51
0
18,530
Hey guys, so I've had this issue going on from quite some time now, over a year at this point. What seems to be happening is if I leave my computer on for just a few hours, I notice in Task manager the process "Service Host: Diagnostic Policy Service" is showing an insane amount of Memory/RAM usage, with the Power Usage always at Very High. If the computer is on for days, when I check the Task Manager my total memory can be 75% or higher used, with that process showing as using 3.5k memory.

I find that if I end that process, I gain like 20-25% Memory back near instantly, but the process restarts almost instantly, so hours later it will be high again. It also seems the longer I leave the computer one and close the process many different times, the total memory used stays higher, as if there is also a leak and i don't get all the memory back. As a reference, checking the same process on my friend's Laptop showing uptime of 2 days so far, the process is sitting at 28.9 MB. Has anyone else seen this issue with this particular process and/or know a possible fix? I'm afraid to play any games lately due to that process wasting all my memory.

Only thing I have tried to do is an SFC scan which said fixed some errors but issue remains.

I tried asking in two different Reddit groups and got not one reply surprisingly, so I figured id come back here where I used to get help before back then. Thank you all in advanced!
 
you might be able to use this tool to read the logs.
https://github.com/EricZimmerman/Srum/blob/master/README.md
the logs should be located at c:\windows\system32\sru

you can delete the sru.dat file if the database is corrupted.

you should also be able to use eventvwr to look at the events.

Note: I am not sure which host process does the repairs but some repairs take a long time. for example, scanning the drives for bad spots that are getting read errors. the process has to attempt to read the weak sector over and over until it gets a read without a CRC error. It then moves the sector to another location and marks the weak sector as bad. This is started 5 minutes after the system goes idle but often machines are set to sleep too soon and the process does not get to complete. The "fix" for this is to set your machine to run in high performance mode and leave it run over night. Most common if you have traditional mechanical hard drives in your system. If you just have SSD then you boot into bios and leave the system running in bios without windows running. Then the firmware of the drive will do its repairs of the bad spots on the drive.
if you want windows to do the repairs faster, often the repairs are needed to the pagefile.sys and you can delete the system virtual memory, reboot and turn on the system virtual memory again and it will create a new pagefile.sys the SSD firmware will quickly clean up the old pagefile.sys allocations after the system goes idle. (no file contention with windows using the ssd memory blocks after the file is deleted)
 
Last edited:
Hey guys, so I've had this issue going on from quite some time now, over a year at this point. What seems to be happening is if I leave my computer on for just a few hours, I notice in Task manager the process "Service Host: Diagnostic Policy Service" is showing an insane amount of Memory/RAM usage, with the Power Usage always at Very High. If the computer is on for days, when I check the Task Manager my total memory can be 75% or higher used, with that process showing as using 3.5k memory.

I find that if I end that process, I gain like 20-25% Memory back near instantly, but the process restarts almost instantly, so hours later it will be high again. It also seems the longer I leave the computer one and close the process many different times, the total memory used stays higher, as if there is also a leak and i don't get all the memory back. As a reference, checking the same process on my friend's Laptop showing uptime of 2 days so far, the process is sitting at 28.9 MB. Has anyone else seen this issue with this particular process and/or know a possible fix? I'm afraid to play any games lately due to that process wasting all my memory.

Only thing I have tried to do is an SFC scan which said fixed some errors but issue remains.

I tried asking in two different Reddit groups and got not one reply surprisingly, so I figured id come back here where I used to get help before back then. Thank you all in advanced!
An option......disable the diag policy service......keep go backups.