ImageGlass
ImageGlass copied to clipboard
ImageGlass process(es) sometimes stays open and hogs CPU after closing app
No idea how to replicate this but sometimes ImageGlass' process will stay active in the background after closing the app and hog about 30% of my CPU. This can happen multiple times too, resulting in multiple processes hogging 30% CPU each. I just updated from 8.2 to 8.5 and thought the bug was gone but nope.
Off-hand do you recall if the thumbnail bar was visible at the time of closing? Or did you edit (crop/rotate) the file you were looking at when you closed?
[These are the likeliest things I can think of off-hand which might be still running in the background at exit.]
Nope, neither. Was just looking at images and that is it.
I've yet to see the "hogging 30% of the CPU" issue, but I was able to get IG to have three background processes running with 8.5.1.22.
- No IG background process.
- Run IG. In settings, check "continue running background"; save. Exit IG.
- Note there is an IG background process.
- Run IG. In settings, uncheck "continue running background"; save. Exit IG.
- Note there is still an IG background process. [Bug!]
- Run IG. In settings, check "continue running background"; save. Exit IG.
- There are now two IG background processes. [Bug!]
- Run IG. Make sure that "allow multiple instances" option is OFF. After that, when exiting IG, there are now three background IG processes. [Bug!] Also, running IG at this point does not show the welcome picture, even though that setting is on. [Bug?]
Turning off the "background" option in IG, and not checking "Start with OS", then a reboot or re-login will probably be required to clear all background processes. [Or killing them manually via Task Manager.]
As far as the 30% CPU issue, I'm still investigating, but make sure that "check for update automatically" is not selected when running IG.
One thing that occurs to me: when IG is "closed", the current FileWatcher doesn't appear to be stopped. I believe this means the IG background process is still watching the last viewed image folder. If that folder is "active" then IG could spend some cycles processing changes which aren't being viewed.
This is somewhat tangential, but you mentioned it in your reproduction steps, how is "allow multiple instances" supposed to work with "continue running in background"? To me they seem mutually exclusive.
The only way I can see them working together is if ImageGlass used multiple windows for viewing images. The code isn't really conducive to this, when looking at it there seems to be an assumption that the process only has one viewport window.
If it has multiple instances, only the last instance will be kept running.
You can see the implementation below: https://github.com/d2phap/ImageGlass/blob/7c416b299c2b5bf9f4acbc4c603a41e68fa64047/Source/ImageGlass/frmMain.cs#L3246-L3272
Should not an issue with v9