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

100% CPU usage during imageproc::window::display_image on Linux #504

Closed
notgull opened this issue Jul 30, 2022 · 2 comments
Closed

100% CPU usage during imageproc::window::display_image on Linux #504

notgull opened this issue Jul 30, 2022 · 2 comments

Comments

@notgull
Copy link

notgull commented Jul 30, 2022

While running the display_image function, one of the CPU's on my computer suddenly rockets up to using 100% of the CPU.

100% usage on one CPU

Looking into the backtraces while running gdb, it appears to be happening during sdl2 event retrieval. However, a brief investigation into sdl2's codebase yields nothing that would cause this, and I'm unsure if this issue originates in imageproc or in one of its dependencies.

Here is the program I'm using it in, although I doubt it's that.

@theotherphil
Copy link
Contributor

I’ve never used sdl2 myself, but from a quick look at the code for this function it looks like the issue is using poll_iter rather than wait_iter.

I won’t have time to work on fixing this myself, but would be very happy to accept a PR if this works.

for event in event_pump.poll_iter() {

https://docs.rs/sdl2/latest/sdl2/struct.EventPump.html

@theotherphil
Copy link
Contributor

Fixed by #515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants