brndnmtthws / conky

Light-weight system monitor for X, Wayland (sort of), and other things, too
https://conky.cc
GNU General Public License v3.0
7.27k stars 620 forks source link

imlib_cache_flush_interval is not observed #1046

Closed simotsa closed 1 year ago

simotsa commented 3 years ago

Issue

imlib_cache_flush_interval config is not observed by conky. conky will attempt to reload the picture everytime it refreshes (based on update_interval).

Information

The following config is used:

conky.config = {
  background=true,
  update_interval=4,
  total_run_times=0,
  own_window=true,
  own_window_type='normal',
  own_window_class='conky-semi',
  own_window_hints='undecorated,below,sticky,skip_taskbar,skip_pager',
  double_buffer=true,
  minimum_width=2560,
  minimum_height=1440,
  imlib_cache_size=60000000,
  imlib_cache_flush_interval=3660
}

conky.text = [[
${image /home/user/Pictures/DSC08391.png -p 0,0 -s 2560x1440 -f 3660}
]]

And you will find that the png file is being read every 4 seconds instead of every 3600 seconds:

$ inotifywait -m Pictures/DSC08391.png
Pictures/DSC08391.png OPEN
Pictures/DSC08391.png ACCESS
...
Pictures/DSC08391.png ACCESS
Pictures/DSC08391.png CLOSE_NOWRITE,CLOSE

This is problematic because the loading of image is using up the CPU time and slow down the conky's rendering cycle.

$ conky -v

conky 1.11.6 compiled 西元2021年01月05日 (週二) 23時28分35秒 EST for Linux 4.19.160-gentoo x86_64

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib64/conky

 General:
  * hddtemp
  * portmon
  * IPv6
  * iconv
  * wireless
  * support for IBM/Lenovo notebooks
  * builtin default configuration
  * old configuration syntax
  * Imlib2
  * OSS mixer support
  * iostats
  * ncurses
  * Internationalization support

 Lua bindings:
  * Cairo
  * Imlib2
  * RSVG
 X11:
  * Xdamage extension
  * Xshape extension (click through)
  * XDBE (double buffer extension)
  * Xft
  * ARGB visual
  * Own window

 Default values:
  * Netdevice: eno1
  * Local configfile: $HOME/.conkyrc
  * Localedir: /usr/share/locale
  * Maximum netdevices: 256
  * Maximum text size: 16384
  * Size text buffer: 256
simotsa commented 3 years ago

Here's the output when conky is ran with debug switch:

So according to the debug, it isn't flushing the cache every cycle, but the image is still being loaded every cycle. The image is only 1MB in file size, so it should be in the cache.

DEBUG(0) [/tmp/portage/app-admin/conky-1.11.6-r2/work/conky-1.11.6/src/imlib2.cc:239]: Flushing Imlib2 cache (1609908673)

DEBUG(0) [/tmp/portage/app-admin/conky-1.11.6-r2/work/conky-1.11.6/src/imlib2.cc:182]: Drawing image '/home/user/Pictures/DSC08391.png' at (0,0) scaled to 2560x1440, caching interval set to 3660 (with -n opt 0)

DEBUG(0) [/tmp/portage/app-admin/conky-1.11.6-r2/work/conky-1.11.6/src/imlib2.cc:182]: Drawing image '/home/user/Pictures/DSC08391.png' at (0,0) scaled to 2560x1440, caching interval set to 3660 (with -n opt 0)

DEBUG(0) [/tmp/portage/app-admin/conky-1.11.6-r2/work/conky-1.11.6/src/imlib2.cc:182]: Drawing image '/home/user/Pictures/DSC08391.png' at (0,0) scaled to 2560x1440, caching interval set to 3660 (with -n opt 0)
github-actions[bot] commented 1 year ago

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment, or this issue will be closed in 30 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 30 days with no activity.