linuxmint / cinnamon-settings-daemon

The settings daemon for the Cinnamon desktop
GNU General Public License v2.0
57 stars 58 forks source link

csd-background increasing memory usage when turning on display with AVIF image #384

Closed Tibladar closed 11 months ago

Tibladar commented 11 months ago
 * csd version: 5.8.1+victoria
 * Distribution: Mint 21.2 Cinnamon
 * Graphics: AMD 5700 Mesa 23.1.8

Issue When turning the display off and on again with an AVIF background image the process csd-background uses more RAM. It probably loads/holds the background image multiple times or theres a problem with the AVIF handler.

Screenshots taken after turning the display off and on: grafik And so on, there's no limit. Memory usage depends on used AVIF image, I used https://raw.githubusercontent.com/link-u/avif-sample-images/master/fox.profile1.10bpc.yuv444.odd-width.odd-height.avif

When killing the process it respawns with initial memory usage.

Steps to reproduce

Expected behaviour

mtwebster commented 11 months ago

I did some investigating on this. I was unable to even debug csd-background for memory leaks - as soon as I tried to set a wallpaper, the debugger itself would crash.. I even tried a different loader/library, same thing.

I found this: https://github.com/strukturag/libheif/issues/509

The fix for this is only available in version 1.13 - Mint 21 has 1.12, unfortunately, so I built a newer version myself, and it seems to eliminate these large memory jumps in csd-background.

I'm going to try and get a newer version backported to Mint 21, and I'll fix our cinnamon-settings Background page, which doesn't appear to recognize this format.

It was fairly easy to build - if you're interested I can provide some steps.

Tibladar commented 11 months ago

Upgrading libheif works fine (heif-gdk-pixbuf libheif1 libheif-examples heif-thumbnailer) and seems to solve the problem: image

clefebvre commented 11 months ago

libheif 1.14.2 backported.