[Panel-devel] QPixmapCache cache flushing

Mark Kretschmann kretschmann at kde.org
Thu Sep 13 09:33:48 CEST 2007


Hey all,

Plasma is using QPixmapCache for caching SVG's. The problem we Amarok
people have with this is that QPixmapCache automatically flushes its
cache after about one minute of idleness. This is done by "void
QPMCache::timerEvent(QTimerEvent *)":

/*
  This is supposed to cut the cache size down by about 80-90% in a
  minute once the application becomes idle, to let any inserted pixmap
  remain in the cache for some time before it becomes a candidate for
  cleaning-up, and to not cut down the size of the cache while the
  cache is in active use.
*/

The problem with this is that if you switch to another virtual desktop
for a while, and then switch back to Amarok, Plasma has to render all
SVG's again, including the wallpaper we use. This takes about 2-5
seconds, depending on your machine, so it's quite a noticeable lag.
During this time Amarok is completely frozen.

Unfortunately this behavior is not configurable in QPixmapCache, so
I'm a bit at a loss here. The only solution I currently see is making
plasma use a different pixmap cache class.

Any ideas?

-- 
Mark


More information about the Panel-devel mailing list