tev: High CPU usage on Windows
I recently updated my tev binary (Windows, pre-built) from v1.17 to v1.19 and experience a consistent high CPU load of tev (1 thread, 100%). This happens even if I just start the application in idle with no images loaded yet.
I think it is connected to the IPC communication as I observed some interesting behaviour there:
Background
I have an app that starts the tev process, connects to it over TCP, sends a CreateImage, then an UpdateImage packet. I can also repeat this process on the click of a button.
Steps
When I open an image the first time, the tev instance opens correctly, but doesn’t show the image. Tev runs with 100% CPU load on one thread. Even if I reopen the image (different name, so new CreateImage, UpdateImage combo) from my GUI it doesn’t show either. If I close the tev window, the process stays there, with 100% CPU load on one thread.
If I kill the tev process, and click on the “reopen image” button again, a second instance opens, and shows the image correctly on the first go.
Thoughts
I’m inclined to rule out my side of the IPC implementation, as it works fine with v1.17 (every time) and v1.19 (the second time). Even if this is unrelated to IPC, the high CPU load is still indicating a blocking call (possibly some mutex) somewhere.
PS: It doesn’t matter if the instance is the primary or a secondary. The CPU load is high in both cases.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 17 (12 by maintainers)
Ouch, I must have force pushed onto the submodule at some point… good lesson to never do that again in the future. Sorry about breaking bisect.
In any case: thanks for reporting this! I’m currently abroad without access to a Windows machine, so it’ll be a couple of days until I can have a closer look.
Breaking on the sleep call seems correct FWIW (and should mean that that thread isn’t responsible for the 100% CPU usage… unless something is seriously wrong with sleep_for)