WerWolv / ImHex

šŸ” A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
https://imhex.werwolv.net
GNU General Public License v2.0
44.8k stars 1.95k forks source link

[Bug] High CPU usage in background #1870

Open mykola2312 opened 2 months ago

mykola2312 commented 2 months ago

Operating System

Linux

What's the issue you encountered?

So, I minimized window and left ImHex running when I was AFK. Returning to laptop I noticed that it got very hot and I opened btop. I noticed, that ImHex was using a significant amount of CPU for no reason whatever.

Also, the ELF pattern have been loaded to display contents of ELF file

output of ps

āžœ  ~ pgrep Main
28165
28447
āžœ  ~ ps -p 28447 -o %cpu,%mem,cmd
%CPU %MEM CMD
71.6  1.3 /usr/bin/imhex
āžœ  ~ ps -p 28165 -o %cpu,%mem,cmd
%CPU %MEM CMD
88.9  1.3 /usr/bin/imhex

in btop pic

How can the issue be reproduced?

Just open ImHex, minimize it and let it run.

ImHex Version

1.34.0

ImHex Build Type

Installation type

https://data.gpo.zugaina.org/hamari/app-editors/imhex/imhex-1.34.0.ebuild

Additional context?

OS: Gentoo 2.15 x86_64
KDE Plasma Version: 5.116.0
Qt Version: 5.15.14
Kernel Version: 6.6.35-gentoo-dist (64-bit)
Graphics Platform: Wayland

ImHex gentoo overlay provided by hamari: https://data.gpo.zugaina.org/hamari/app-editors/imhex/imhex-1.34.0.ebuild

WerWolv commented 2 months ago

Hey This is due to glfw not sleeping correctly in the Wayland window implementation. As of right now, there's basically nothing I can do about this, sorry.

mykola2312 commented 2 months ago

Hey This is due to glfw not sleeping correctly in the Wayland window implementation. As of right now, there's basically nothing I can do about this, sorry.

omg bruh its wayland issue.... ok thanks!!!

mykola2312 commented 2 months ago

Hey This is due to glfw not sleeping correctly in the Wayland window implementation. As of right now, there's basically nothing I can do about this, sorry.

How do I force it to run in Xwayland?

Redbeanw44602 commented 1 month ago

Hmm, I use X11 and also encountered this problem. The ImHex version is v1.35.4, which is exactly the same as the original poster's problem.

Moreover, ImHex does not occupy the CPU abnormally when it is in the foreground. Only when I minimize it, the laptop's cooling fan starts whirring.

bbbbbr commented 3 weeks ago

Been seeing this for a while too and finally getting around to commenting on it. :)

My system is also using X11 and the issue (CPU usage spikes to ~70+%) reproduces pretty easily when switching desktops (away from the one imhex is on).

Same as with the comment above, when restored to view by re-focusing the desktop it's on then the CPU use goes back down to less than 1%.

Attached is a video showing it (version 1.35.3) https://github.com/user-attachments/assets/1560f0c2-3f9c-42c7-8d91-cb34a5fd5709