Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#802306: packagekitd eating up RAM

128 views
Skip to first unread message

Stephen Kitt

unread,
Dec 19, 2015, 5:40:03 AM12/19/15
to
Package: packagekit
Version: 1.0.11-1
Followup-For: Bug #802306

Dear Maintainer,

I'm also seeing excessive RAM use; packagekitd is currently using
4.8GB of RAM (on my 32GB system).

Regards,

Stephen


-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (500, 'testing'), (500, 'stable'), (200, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.2.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages packagekit depends on:
ii gdebi-core 0.9.5.7
ii libapt-inst2.0 1.1.4
ii libapt-pkg5.0 1.1.4
ii libc6 2.21-4
ii libgcc1 1:5.2.1-23
ii libglib2.0-0 2.46.2-1
ii libglib2.0-bin 2.46.2-1
ii libgstreamer1.0-0 1.6.1-1
ii libpackagekit-glib2-18 1.0.11-1
ii libpolkit-gobject-1-0 0.105-14
ii libsqlite3-0 3.9.2-1
ii libstdc++6 5.2.1-23
ii libsystemd0 228-2
ii policykit-1 0.105-14

Versions of packages packagekit recommends:
ii packagekit-tools 1.0.11-1

Versions of packages packagekit suggests:
ii appstream [appstream-index] 0.8.6-1

-- no debconf information

Sam Hocevar

unread,
Jan 5, 2016, 11:10:04 AM1/5/16
to
On Sat, Dec 19, 2015, Stephen Kitt wrote:

> Dear Maintainer,
>
> I'm also seeing excessive RAM use; packagekitd is currently using
> 4.8GB of RAM (on my 32GB system).

I’m tempted to suggest raising the severity of this bug. It has
become unbearable, the insane memory usage of packagekitd causes
processes to be randomly killed, compilations to fail, X to hang in
inconsistent states (the mouse loses its ability to focus windows),
several of our machines regularly become unusable for several minutes
due to this apparent leak. Sometimes it’s faster to reboot the machine
than to wait for it to become responsible again.

Just as I am writing this, packagekitd is using 1.8 GiB (RSS). /proc
indicates that most of it is heap memory. This really feels like a
serious bug to me.

Regards,
--
Sam.

Matthias Klumpp

unread,
Jan 5, 2016, 11:20:04 AM1/5/16
to
Hmm, are you doing anything special with PK which could trigger this
issue, so I can reproduce it?
PK itself should terminate after idling for a while, freeing any
resources it still uses.
In order to debug a potential memory leak, I would first need to be
able to reproduce it...
Cheers,
Matthias

Sam Hocevar

unread,
Jan 5, 2016, 12:10:03 PM1/5/16
to
On Tue, Jan 05, 2016, Matthias Klumpp wrote:
> Hmm, are you doing anything special with PK which could trigger this
> issue, so I can reproduce it?

No, I’m afraid that’s the strange thing, I don’t do anything
with PK. I run a GNOME desktop but have never launched software or
performed any action related to packagekitd as far as I can tell. I
only install stuff through apt-get. I do have /usr/bin/gnome-software
running, which seems to be related to PK, but I suppose it comes with
modern GNOME.

I do have a large sources.list, though not insanely so (see attachment).

strace()ing the PK process shows that it constantly checks for the
existence of /system-update and /var/lib/PackageKit/prepared-update. The
comment in pk_offline_auth_invalidate() suggests that this should be a
rare occurrence, yet it happens every second (I could misunderstand the
code; it’s my first time having a look at it).

It’s pretty hard to troubleshoot anything because the box is
currently quite unresponsive, but I can try to come up with more
information if it can help.

> PK itself should terminate after idling for a while, freeing any
> resources it still uses.

Well, it’d be nice if it released those gigabytes of RAM, sure, but
I’d be even happier if it actually didn’t need several gigabytes of
RAM in order to work :-)

Regards,
--
Sam.
sources.list

Stephen Kitt

unread,
Jan 5, 2016, 2:30:03 PM1/5/16
to
On Tue, 5 Jan 2016 17:11:41 +0100, Matthias Klumpp <matt...@tenstral.net>
wrote:
> Hmm, are you doing anything special with PK which could trigger this
> issue, so I can reproduce it?

No, like Sam I'm just running Gnome, without even using gnome-software.

> PK itself should terminate after idling for a while, freeing any
> resources it still uses.

It's packagekitd that's using tons of RAM, isn't that a service started by
systemd?

"systemctl status packagekit" produces

● packagekit.service - PackageKit Daemon
Loaded: loaded (/lib/systemd/system/packagekit.service; static; vendor preset: enabled)
Active: active (running) since Mon 2016-01-04 20:04:22 CET; 24h ago
Main PID: 3863 (packagekitd)
CGroup: /system.slice/packagekit.service
└─3863 /usr/lib/packagekit/packagekitd

Jan 04 20:04:22 heffalump.sk2.org systemd[1]: Starting PackageKit Daemon...
Jan 04 20:04:22 heffalump.sk2.org PackageKit[3863]: daemon start
Jan 04 20:04:22 heffalump.sk2.org systemd[1]: Started PackageKit Daemon.

on my system just now (it was booted a day ago).

> In order to debug a potential memory leak, I would first need to be
> able to reproduce it...

I was thinking of running it with valgrind...

Regards,

Stephen

Matthias Klumpp

unread,
Jan 10, 2016, 2:00:04 AM1/10/16
to
Does this problem also appear when running PK on the command-line?

Please install the packagekit-dbg package and valgrind, then kill the
running packagekitd daemon and run the following command in a terminal
session:

sudo G_DEBUG=gc-friendly G_SLICE=always-malloc valgrind
--tool=memcheck --leak-check=full --leak-resolution=high --xml=yes
--xml-file=vgdump.xml --num-callers=20 /usr/lib/packagekit/packagekitd
--verbose

Then please send me the vgdump.xml file (attached to the bug) - you
can send it in a private mail, if you want to.
You may want to perform some tasks on PK via pkcon, like running
`pkcon refresh` to give the daemon some work to do.
Please quit the daemon by issueing the following DBus call:

gdbus call --system \
--dest org.freedesktop.PackageKit \
--object-path /org/freedesktop/PackageKit \
--method org.freedesktop.PackageKit.SuggestDaemonQuit

Cheers,
Matthias

John Allen

unread,
Jan 11, 2016, 10:10:04 AM1/11/16
to
Package: packagekit
Version: 1.0.11-1
Followup-For: Bug #802306

Dear Maintainer,


* What led up to the situation?
* What exactly did you do (or not do) that was effective (or
ineffective)?
* What was the outcome of this action?
* What outcome did you expect instead?

*** End of the template - remove these template lines ***

I confirm that this bug is present in an up to date Debian testing installation (stretch).

I am running Debian testing via SparkyLinux, with Openbox desktop.

A few days ago I noticed that there were 3 packaged processes each consuming
25% of total RAM (4 GB). I stopped the packaged service via systemctl, system performance
improved. Two days ago I rebooted for a kernel upgrade, packaged restarted and is
now consuming 3x 17 = 51% of RAM. RAM usage is increasing noticeably from day to day.


-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.3.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages packagekit depends on:
ii gdebi-core 0.9.5.7
ii libapt-inst2.0 1.1.10
ii libapt-pkg5.0 1.1.10
ii libc6 2.21-6
ii libgcc1 1:5.3.1-5
ii libglib2.0-0 2.46.2-3
ii libglib2.0-bin 2.46.2-3
ii libgstreamer1.0-0 1.6.2-1
ii libpackagekit-glib2-18 1.0.11-1
ii libpolkit-gobject-1-0 0.105-14
ii libsqlite3-0 3.9.2-1
ii libstdc++6 5.3.1-5
ii libsystemd0 228-2+b1
ii policykit-1 0.105-14

Versions of packages packagekit recommends:
ii packagekit-tools 1.0.11-1

Versions of packages packagekit suggests:
pn appstream-index <none>

-- no debconf information

--
systemctl status:
● packagekit.service - PackageKit Daemon
Loaded: loaded (/lib/systemd/system/packagekit.service; static; vendor preset: enabled)
Active: active (running) since Sat 2016-01-09 20:24:20 CET; 1 day 19h ago
Main PID: 1854 (packagekitd)
CGroup: /system.slice/packagekit.service
└─1854 /usr/lib/packagekit/packagekitd

Jan 09 20:24:20 kirtley systemd[1]: Starting PackageKit Daemon...
Jan 09 20:24:20 kirtley PackageKit[1854]: daemon start
Jan 09 20:24:20 kirtley systemd[1]: Started PackageKit Daemon.

Matthias Klumpp

unread,
Feb 13, 2016, 10:40:03 AM2/13/16
to
Hi!
Can you check if this issue still appears with the latest PackageKit
in unstable (v1.1.0)?
I fixed a few minor memory leaks that I found, and there are also a
few other changes which might have an impact on this - although I am
still a bit in the dark on why this issue happens at all (still can't
reproduce it :-/).
Cheers,
Matthias

Stephen Kitt

unread,
Mar 6, 2016, 9:20:02 AM3/6/16
to
Hi Matthias,

On Sat, 13 Feb 2016 16:33:05 +0100, Matthias Klumpp <matt...@tenstral.net>
wrote:
Sorry for the lack of response, I haven't had the time to look into this in
detail. But it looks like the memory leak is fixed, I have a two-week-old
packagekitd process only using 33MB of RAM.

Regards,

Stephen
0 new messages