Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIDHide Watchdog taking up large amounts of RAM #126

Closed
4 tasks done
rhobiusvoid opened this issue Nov 12, 2023 · 16 comments
Closed
4 tasks done

HIDHide Watchdog taking up large amounts of RAM #126

rhobiusvoid opened this issue Nov 12, 2023 · 16 comments
Assignees
Labels
bug Something isn't working

Comments

@rhobiusvoid
Copy link

  • I have searched open and closed issues for duplicates
  • I am submitting a bug report for existing functionality that does not work as intended
  • I have read the project documentation and not found a solution to my problem there
  • 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

Any other helpful information

n/a

@nefarius
Copy link
Owner

nefarius commented 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.

@nefarius nefarius self-assigned this Nov 12, 2023
@nefarius nefarius added the bug Something isn't working label Nov 12, 2023
@rhobiusvoid
Copy link
Author

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
Copy link
Owner

Yeah I can reproduce it, something isn't get cleaned up properly:

image

I'll look into it. Curious, the service is not awfully complex, wonder what the culprit is.

@rhobiusvoid
Copy link
Author

Well, good to see that it was at least reproducible, would've been a nightmare if it was my system that caused it.

@nefarius
Copy link
Owner

I'll check util::HasDeviceClassFilter this is the most likely culprit since we do not leak handles and this function does allocate strings.

@rhobiusvoid
Copy link
Author

Gotcha. On my end, it's just steadily increasing in kilobytes every few seconds, similar to your reproduction of it.
image

@nefarius
Copy link
Owner

Yeah the thread runs its checks every 5 seconds.

@nefarius
Copy link
Owner

I'll check util::HasDeviceClassFilter this is the most likely culprit since we do not leak handles and this function does allocate strings.

Interesting, that function is innocent, I removed it and ramped up the polling rate, still leaks:

image

@rhobiusvoid
Copy link
Author

and it's leaking even faster

@nefarius
Copy link
Owner

and it's leaking even faster

Because I changed 5 seconds to 50 milliseconds 😉

@nefarius
Copy link
Owner

Yep, CheckServiceStatus is at fault. Now to figure out why.

@nefarius
Copy link
Owner

Found and fixed it! Thanks for reporting! Next release will contain the fixed version.

@rhobiusvoid
Copy link
Author

nicely done, and good to hear!

@nefarius
Copy link
Owner

Looking good now:

image

@nefarius
Copy link
Owner

@rhobiusvoid could you test this new build pls before I make a release, thanks: HidHide_1.4.192_x64.exe.zip

@rhobiusvoid
Copy link
Author

rhobiusvoid commented 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.
image

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants