JuliaImages / ImageView.jl

Interactive display of images and movies
MIT License
135 stars 34 forks source link

Windows becomes laggy when opening ImageView #281

Closed marcsgil closed 1 year ago

marcsgil commented 1 year ago

I've encountered an issue with ImageView on my Windows PC. When I open an environment that contains only ImageView and then load the package, my entire OS becomes laggy. The issue persists until I close the Julia session. In the video below, I demonstrate this behavior by pressing the 1 key for a few seconds to show the normal speed. Then, I load the package and press 1 again for a few seconds, showing the much slower response time.

https://github.com/JuliaImages/ImageView.jl/assets/80797341/ad844a26-4860-4aa3-ae00-cf21f69391d3

This issue occurs almost every time I try to use ImageView on my Windows PC, including with Julia LTS. However, I don't experience any problems on my Linux machine.

Here's the output of versioninfo():

Julia Version 1.9.0
Commit 8e63055292 (2023-05-07 11:25 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × 12th Gen Intel(R) Core(TM) i5-12600K
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, alderlake)
  Threads: 16 on 16 virtual cores
Environment:
  JULIA_NUM_THREADS = auto
ashwani-rathee commented 1 year ago

I can confirm this is noticed in my case too for 1.8.5 and 1.9 for the first time I reproduce this 1111... scenario but when I repeat it after enter again, it goes back to normal speed. When I just open Julia, it utilizes 100 mb of RAM and when I do using ImageView and after , it goes to 368 MB RAM usage.

marcsgil commented 1 year ago

I can confirm this is noticed in my case too for 1.8.5 and 1.9 for the first time I reproduce this 1111... scenario but when I repeat it after enter again, it goes back to normal speed. When I just open Julia, it utilizes 100 mb of RAM and when I do using ImageView and after , it goes to 368 MB RAM usage.

I have seen it magically going away after I type a few things, but the behavior isn't consistent to me.

marcsgil commented 1 year ago

Upon seeing this post on Julia Discourse, I discovered that this is a long standing issue with GTK.jl (see here). A simple workaround is to run ENV["GTK_AUTO_IDLE"] = false before importing the package. With that in mind, I'm closing the issue.