! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Redundant call to backdrop_changed_cb without changing current_workspace
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description Jan Ziak (http://atom-symbol.net) 2020-04-28 19:09:16 CEST
Hello.

This bug is a continuation of previous attempts (bug #16314) to improve the long-term memory consumption of xfdesktop.

When the user is changing workspaces and all the workspaces look the same, xfdesktop will unnecessarily call backdrop_changed_cb which leads to memory allocations and which due to memory fragmentation increases xfdesktop's memory consumption (RES in top/htop).

A patch fixing this issue will be added to this bug report in a few minutes.
Comment 1 Jan Ziak (http://atom-symbol.net) 2020-04-28 19:33:44 CEST
Created attachment 9815 
Patch in git format

This patch reduces memory consumption on a 4K display by about 33 MB when switching workspaces. Longer-term memory consumption can be reduced by up to 85 MB (with a 4K display).

As a side-effect, xfdesktop is now consuming about 1-3 ms of CPU time per workspace switch. Previously, it was consuming about 15-30 ms.

Please review this patch and test whether it reduces memory consumption as advertised.
Comment 2 Andre Miranda editbugs 2020-05-06 01:55:59 CEST
I can't reproduce the leak with my setup (HD + Full HD displays), xfdesktop starts at about 75MB and after switching multiple times between three workspaces (each with a different wallpaper) it goes to 118~126MB, I couldn't see any difference with or without your patch.
Comment 3 Andre Miranda editbugs 2020-05-06 01:57:51 CEST
By the way, I'm inclined to merge it, since it caused no regressions and seems to make sense, but being able to reproduce feels safer :)
Comment 4 Jan Ziak (http://atom-symbol.net) 2020-05-06 17:40:04 CEST
(In reply to Andre Miranda from comment #2)
> I can't reproduce the leak with my setup (HD + Full HD displays), xfdesktop
> starts at about 75MB and after switching multiple times between three
> workspaces (each with a different wallpaper) it goes to 118~126MB, I
> couldn't see any difference with or without your patch.

I forgot to mention that the patch applies only to the case of having a single wallpaper on all workspaces. In the case of multiple wallpapers, the current_workspace variable isn't a constant/invariant.
Comment 5 Git Bot editbugs 2020-05-07 02:39:18 CEST
Jan Ziak referenced this bugreport in commit 481fbfd95b2bec9378556d42c7c3e88676381679

Avoid redundant calls to backdrop_changed_cb (Bug #16773)

https://gitlab.xfce.org/xfce/xfdesktop/commit/481fbfd95b2bec9378556d42c7c3e88676381679
Comment 6 Andre Miranda editbugs 2020-05-07 02:40:46 CEST
With single wallpaper the memory consumption doesn't increase while switching workspaces, thanks!

Bug #16773

Reported by:
Jan Ziak (http://atom-symbol.net)
Reported on: 2020-04-28
Last modified on: 2020-05-07

People

Assignee:
Xfce Bug Triage
CC List:
2 users

Version

Version:
4.14.2

Attachments

Patch in git format (1.33 KB, patch)
2020-04-28 19:33 CEST , Jan Ziak (http://atom-symbol.net)
0xe2.0x9a.0x9b : review? ( andreldm )

Additional information