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
42.8k stars 1.88k forks source link

[Bug] High CPU usage in background #1870

Open mykola2312 opened 2 weeks ago

mykola2312 commented 2 weeks 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 weeks 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 weeks 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 weeks 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 5 days 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.