Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leak in xdg-permission-store when deleting data after uninstalling package #833

Open
ranisalt opened this issue Jul 14, 2022 · 5 comments
Open
Labels
need more info needs diagnosis Root cause of the issue needs to be diagnosed permissions Issues and feature requests related to permissions

Comments

@ranisalt
Copy link

ranisalt commented Jul 14, 2022

Hello! I'm facing an issue where the process for xdg-permission-store where it allocates huge loads of memory whenever an uninstalled package is deleting data, i.e. when running flatpak remove --delete-data <package> after pressing y when it prompts Delete data for <package>? [y/n].

This causes memory usage to ramp up very quickly, and it never deallocates. I'm talking about gigabytes on each uninstall, I just removed two packages (com.github.wwmm.easyeffects and org.freedesktop.LinuxAudio.Plugins.LSP) and xdg-permission-store is sitting at ~6 GB memory usage. It increases about 3 GB for each package, until it uses 100% of my RAM and crashes the system, requiring a hard reset.

image

After uninstalling 2 more packages, it peaked at 10.6 GB:

image

Killing the process does not seem to cause any issues. I don't know of any logs to annex, but am willing to share whatever information is necessary to fix ;)

@ranisalt
Copy link
Author

Update: this seems to heavily affect the cleanup process, it takes several minutes to remove packages even if they have almost no data in disk, and I have a fast SSD.

@GeorgesStavracas GeorgesStavracas added need more info needs diagnosis Root cause of the issue needs to be diagnosed permissions Issues and feature requests related to permissions labels Oct 11, 2023
@Mikenux
Copy link

Mikenux commented Nov 28, 2023

I can't reproduce the RAM bug with xdg-desktop-portal 1.18.2 (Fedora 39, GNOME). I monitored that with System Monitor from GNOME. However, I am able to reproduce the high disk write activity.

@ranisalt: Are you able to reproduce with a more recent xdg-desktop-portal version (ideally, the latest: 1.18.2)?

@Mikenux
Copy link

Mikenux commented Nov 29, 2023

Better with numbers.

OS: Fedora Linux 39, GNOME 45.1, xdg-desktop-portal 1.18.2.

I used System Monitor from GNOME to monitor memory usage of xdg-permission-store.

I used the following commands, two times:
flatpak install Kamoso: I made a system install. The app comes from flathub repository. It installs: org.kde.KStyle. Adwaita, org.kde.Platform.Locale, org.kde.PlatformTheme.QGnomePlatform, org.kde.WaylandDecoration.QAdwaitaDecorations, org.kde.WaylandDecoration.QGnomePlatform-decoration, org.kde.Platform, and org.kde.kamoso.locale, org.kde.kamoso
flatpak remove --delete-data Kamoso
flatpak remove --unused --delete data

I also launched Text Editor (flatpak) to take notes.

Numbers:

  • Resident Memory: 6.2 MB -> 6.3 MB (Text Editor launch) -> 8.1 to 8.3 MB (remove --delete-data Kamoso) -> 8.5 MB (remove --unused --delete-data) -> 8.6 to 8.7 MB (remove --unused --delete-data, second time))
  • Shared Memory: 5.8 MB -> 5.9 MB (Text Editor launch) -> 6.6 MB (remove --delete-data Kamoso) -> 6.6 MB (no change in second time)
  • Memory: 392.2 KB -> 1.8 MB (Kamoso --delete-data) -> 1.9 MB (remove --unused --delete-data) -> 2.1 to 2.2 MB (remove --unused --delete-data, second time)

This bug is also a duplicate of #748 (where I took the Kamoso example).

@hfiguiere
Copy link
Collaborator

When I try to run this with the xdg-permission-store run under valgrind, I get the --delete-data hung.

@incloxe
Copy link

incloxe commented Feb 13, 2024

Just cross-posted over at #748. System is at 11.8GB memory usage for xdg-permission-store & can also say that the --delete-data hangs abnormally long.

One thing to note is that initially my system was hanging with --delete-data, but the memory leak had not yet occurred. Only recently did the memory leak happen.

Starting fresh will solve things, but I'm interested in the outcome of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info needs diagnosis Root cause of the issue needs to be diagnosed permissions Issues and feature requests related to permissions
Projects
Status: Triaged
Development

No branches or pull requests

5 participants