dlprows / FocusVolumeControl

Stream Deck+ plugin for controlling the focused application's volume
MIT License
3 stars 1 forks source link

CPU usage spike #2

Closed X-Olem-X closed 9 months ago

X-Olem-X commented 9 months ago

Hello, while just flipping through browser tabs and apps I keep getting my CPU usage to spike up anywhere from 11-17%, and up to 20c in temperature, and it lingers there for minutes usually before returning to normal. https://ibb.co/mDJ5MpZ

dlprows commented 9 months ago

I'm trying to reproduce this, and I'm not able to.

Is this happening all the time, or just every once in a while? Does it happen just when switching between browser tabs, or when changing back and forth between browser tabs and apps? Are you using chrome or a different browser?

Any feedback would be helpful. On my machine, I can't get it to go over 2%, and it comes back down pretty instantly

X-Olem-X commented 9 months ago

So i'm using Brave Browser, and would say it falls under the every once in a while category, I can't reproduce it constantly, but it happens at random, lasting minutes at a time when it does happen.

Most of the time I have been able to cause it to go off I have had multiple regular windows across a couple monitors, plus a private window, plus one or two other apps, and just swapping around casually, yet not every time.. Its proving difficult to find a specific action that sets it off.

Will keep messing around and let you know if I can find a specific action.

dlprows commented 9 months ago

My current leading idea based on the screenshot, and the difference I'm seeing with my machine, is that the memory usage on yours looks a lot higher. its by no means "high" but its high enough that garbage collection could be running.

That had me wondering if the library I'm using to access the volume mixer information has a memory leak in it.

If its not inconvenient, if you could keep an eye on whether the memory goes down when the cpu usage spikes, that'd be helpful

X-Olem-X commented 9 months ago

So right now I would say, once the spike happens (Just had one), CPU usage keeps bouncing between 11-18% and memory keeps building ever higher, started around 100MB and peaked up at 465MB before I finally killed the program.

I have noticed that using the snipping tool for taking a screenshot does consistently cause the memory to increase, every single time you use it, not sure if it ever stops building.. but tried it over 20 times and kept increasing and prolonging the spike.

dlprows commented 9 months ago

Yeah, I'm pretty sure its a memory leak in the audio library. I switched from it to making the com calls directly, and the leaks i could find with a memory profiler went away, and I'm seeing it stick closer to 25 MB.

Its a drastic enough change in the code that I want to give it a couple of days worth of usage before I send it to elgato to update the marketplace, but if you'd like I can post the new build on here so that you can try it out and let me know if it solves your problem.

X-Olem-X commented 9 months ago

Sure, would appreciate that, I will give it a try and let you know if I get anymore spikes.

dlprows commented 9 months ago

https://github.com/dlprows/FocusVolumeControl/releases/tag/v1.1.1-prerelease

X-Olem-X commented 9 months ago

I think you fixed it, no issues all day and yesterday evening since updating, Thanks! its an awesome little plugin!