Animated GIFs + clock cause "convert" CPU spikes. Filter those out for wallpaper usage.

Bug #1290620 reported by Joshua Mounce
44
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Variety
Fix Released
High
Peter Levi

Bug Description

Ubuntu Unity 12.04 64bit
Kernel Linux 3.8.0-36-generic
GNOME 3.4.2
Memory: 1.7G
Processor: Intel® Pentium(R) CPU P6200 @ 2.13GHz × 2

Suddenly, my system was running incredibly slow. utilizing 97% of my RAM on a constant basis with nothing active running. Poking around I found the majority of the resources were going to a process called "convert". After killing the process, I'm currently running smoothly at only 43% with several programs running. Killing the processes has had no other visible effect on my system, and it only runs smoother now. Though it takes a few minutes to get there because reboots bring this right back up again. It was suggested on linuxquestions.org that convert was part of imagemagick, which is apparently part of variety. After uninstalling imagemagick (and thus variety), I haven't seen the bug return.

Related branches

Revision history for this message
Peter Levi (peterlevi) wrote :

Yes, convert is part of ImageMagick. ImageMagick is not part of Variety - Variety depends on it and uses it to provide clock and effects. If you turn off clock and effects in Variety, convert will not be run at all. If you use them, Variety runs 'convert' on wallpaper change, and it would load the CPU for some time until it finishes processing the image - for the clock and most filters this time is less than a second, some filters like blurring take a couple of seconds. It is not supposed to eat a lot of RAM unless it is processing some enormous image.

Can you please attach here the file ~/.config/variety/variety.conf if you still have it. I'd like to see what filters you had enabled. Thanks.

Revision history for this message
Joshua Mounce (joshua-mounce) wrote :

Sure. Hope this helps.

Revision history for this message
Peter Levi (peterlevi) wrote :

Ok, so only the clock was enabled. This is basically a fairly standard setup of Variety, which normally does not cause resource leaks. I suppose there might have been some problem with the ImageMagick installation on your machine, causing the convert processes spawned by Variety once a minute - when changing the clock - to hang around, taking up resources. These are normally active for only half a second or so.

If you are interested in helping debug this, you'll have to install Variety again, as it is now I can't do anything else.
If you install it, you can try to manually run this command (fix the paths first) and check it effects on RAM, CPU usage, etc.
Normally it should finish fairly fast without taking too much RAM.

convert "PATH_TO_SOME_LARGE_IMAGE.jpg" -scale 1920x1080^ -density 100 -font `fc-match -f '%{file[0]}' 'Ubuntu Condensed:,:70'` -pointsize 70 -gravity SouthEast -fill '#00000044' -annotate 0x0+58+168 '14:07' -fill white -annotate 0x0+60+170 '14:07' -font `fc-match -f '%{file[0]}' 'Ubuntu Condensed:,:30'` -pointsize 30 -fill '#00000044' -annotate 0x0+58+118 'сряда, март 12' -fill white -annotate 0x0+60+120 'сряда, март 12' "PATH_TO_OUTPUT_IMAGE.jpg"

Changed in variety:
status: New → Incomplete
Revision history for this message
Mateus (mtsgomes-ar) wrote :

I got the same problem when Varity tried to apply a animated gif as wallpaper. (I have clock and quotes enabled)

Revision history for this message
Peter Levi (peterlevi) wrote :

Can you attach the gif here, please. Thanks.

Revision history for this message
rylleman (rylleman) wrote :

I got this as well with an animated gif. I don't have the gif as I deleted it to trash after I was able to kill the process (taking minutes just to open a terminal, htop to find convert was hogging at 100% and killing the process) but it was one from Nasa pic of the day and depicting Mars.

Peter Levi (peterlevi)
Changed in variety:
status: Incomplete → Triaged
importance: Undecided → High
summary: - System process "convert" (imagemagick) found hogging 97% RAM
- continuously
+ Animated GIFs + clock cause "convert" CPU spikes
summary: - Animated GIFs + clock cause "convert" CPU spikes
+ Animated GIFs + clock cause "convert" CPU spikes. Filter those out for
+ wallpaper usage.
Revision history for this message
rylleman (rylleman) wrote :

Of course I do have the gif as it was deleting to trash... Attaching it here.

Peter Levi (peterlevi)
Changed in variety:
status: Triaged → Fix Committed
assignee: nobody → Peter Levi (peterlevi)
James Lu (jlu5)
Changed in variety:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.