You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HIDHide Watchdog taking up large amounts of RAM #126
This isn't a feature request or a discussion topic
Bug description
The Watchdog service that ensures the configs are set properly between updates or system changes is taking huge proportions of RAM, upwards of 300MB.
Steps to reproduce
Unsure how to reproduce this, or what the actual environment for it is, but the watchdog service just seems to keep growing in RAM usage until the user notices and terminates it, letting it start over again.
Actual result: Letting it run over time will just keep growing its RAM usage, likely as a result of some memory leak. Expected result: Should just stay reasonable.
Screenshots
Would've posted one if I hadn't terminated it. Sorry.
Machine info
CPU-Architecture: x64 Windows version: Windows 10 LTSC 21H2 Software/driver version(s): Latest one, part of security bulletin, legacinated
I actually saw it a few days ago, where it was 500MB in RAM, but I thought nothing of it and just simply terminated it. Did a few restarts from then till here cuz of drivers for some dumb camera that didn't end up working, and I decided to peek into task manager cuz something wasn't right with another program, and that's where I saw the Watchdog service at 300MB. I only booted up my PC just an hour ago so the memleak is likely fast. I've since disabled the service, since I've completely disabled Windows Update anyways, but I've re-enabled it for now and I'm just steadily watching it.
Left it running for a good half hour or so, but it only occasionally rises by like 4KB at a very slow rate. Likely just my system at this point and nothing major.
Edit: It stays at 700KB, no rise or fall. Must've just initialized.
Activity
nefarius commentedon Nov 12, 2023
Uh oh. Do you have a relative feeling how long it ran until you noticed? What was the amount, roughly?
Oh, a few hundred megs, yeah that is not normal indeed 😅 we're leaking somewhere.
rhobiusvoid commentedon Nov 12, 2023
I actually saw it a few days ago, where it was 500MB in RAM, but I thought nothing of it and just simply terminated it. Did a few restarts from then till here cuz of drivers for some dumb camera that didn't end up working, and I decided to peek into task manager cuz something wasn't right with another program, and that's where I saw the Watchdog service at 300MB. I only booted up my PC just an hour ago so the memleak is likely fast. I've since disabled the service, since I've completely disabled Windows Update anyways, but I've re-enabled it for now and I'm just steadily watching it.
nefarius commentedon Nov 12, 2023
Yeah I can reproduce it, something isn't get cleaned up properly:
I'll look into it. Curious, the service is not awfully complex, wonder what the culprit is.
rhobiusvoid commentedon Nov 12, 2023
Well, good to see that it was at least reproducible, would've been a nightmare if it was my system that caused it.
nefarius commentedon Nov 12, 2023
I'll check
util::HasDeviceClassFilterthis is the most likely culprit since we do not leak handles and this function does allocate strings.rhobiusvoid commentedon Nov 12, 2023
Gotcha. On my end, it's just steadily increasing in kilobytes every few seconds, similar to your reproduction of it.

nefarius commentedon Nov 12, 2023
Yeah the thread runs its checks every 5 seconds.
nefarius commentedon Nov 12, 2023
Interesting, that function is innocent, I removed it and ramped up the polling rate, still leaks:
rhobiusvoid commentedon Nov 12, 2023
and it's leaking even faster
nefarius commentedon Nov 12, 2023
Because I changed 5 seconds to 50 milliseconds 😉
nefarius commentedon Nov 12, 2023
Yep,
CheckServiceStatusis at fault. Now to figure out why.nefarius commentedon Nov 12, 2023
Found and fixed it! Thanks for reporting! Next release will contain the fixed version.
rhobiusvoid commentedon Nov 12, 2023
nicely done, and good to hear!
nefarius commentedon Nov 12, 2023
Looking good now:
nefarius commentedon Nov 12, 2023
@rhobiusvoid could you test this new build pls before I make a release, thanks: HidHide_1.4.192_x64.exe.zip
rhobiusvoid commentedon Nov 12, 2023
Left it running for a good half hour or so, but it only occasionally rises by like 4KB at a very slow rate. Likely just my system at this point and nothing major.

Edit: It stays at 700KB, no rise or fall. Must've just initialized.
Fixes nefarius#126