PolicyKit high memory usage

Bug #1470235 reported by bmaupin
110
This bug affects 22 people
Affects Status Importance Assigned to Milestone
policykit-1 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Periodically I install updates on my computer and reboot without logging in. When I come back to my computer and log in, polkitd is using a large chunk of memory. At the moment it's using > 2.3 GiB of memory on a machine with 8 GB RAM:

$ ps aux | grep polkit
root 1229 0.4 29.8 2652532 2420916 ? Sl Jun19 67:38 /usr/lib/policykit-1/polkitd --no-debug

Killing the process frees the memory until I reboot again.

I'm currently using the latest version of policykit-1:

$ apt-file search /usr/lib/policykit-1/polkitd
policykit-1: /usr/lib/policykit-1/polkitd

$ apt-cache policy policykit-1
policykit-1:
  Installed: 0.105-4ubuntu2.14.04.1
  Candidate: 0.105-4ubuntu2.14.04.1
  Version table:
 *** 0.105-4ubuntu2.14.04.1 0
        500 http://ca.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     0.105-4ubuntu2 0
        500 http://ca.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

$ sudo apt-get upgrade policykit-1
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
policykit-1 is already the newest version.

Other information:

$ lsb_release -rd
Description: Ubuntu 14.04.2 LTS
Release: 14.04

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: policykit-1 0.105-4ubuntu2.14.04.1
ProcVersionSignature: Ubuntu 3.16.0-41.55~14.04.1-generic 3.16.7-ckt11
Uname: Linux 3.16.0-41-generic x86_64
NonfreeKernelModules: fglrx
ApportVersion: 2.14.1-0ubuntu3.11
Architecture: amd64
Date: Tue Jun 30 16:14:51 2015
InstallationDate: Installed on 2014-08-25 (309 days ago)
InstallationMedia: Xubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140723)
ProcEnviron:
 LANGUAGE=en_CA:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
SourcePackage: policykit-1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
bmaupin (bmaupin) wrote :
Revision history for this message
Jon Dallara (jondallara) wrote :

Also seeing the same problem. Takes about 4 days until the system is unresponsive.

Description: Linux Mint 17.1 Rebecca
Release: 17.1

uname -a: Linux Mothership 3.16.0-39-generic #53~14.04.1-Ubuntu SMP Wed May 27 10:03:17 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Attached are top screen shots ~3 hours apart

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in policykit-1 (Ubuntu):
status: New → Confirmed
Revision history for this message
Jon Dallara (jondallara) wrote :
Revision history for this message
bmaupin (bmaupin) wrote :

A couple more data points:

Last week, I rebooted my machine and logged in right away. polkitd was only using 7 MB of memory:

$ ps aux | grep polkitd | grep -v grep
root 1219 0.1 0.0 281164 7244 ? Sl 16:36 0:00 /usr/lib/policykit-1/polkitd --no-debug

Two days later, polkitd was using only marginally more memory:

$ uptime
 17:08:55 up 2 days, 32 min, 2 users, load average: 1.42, 0.78, 0.37
$ ps aux | grep polkitd | grep -v grep
root 1219 0.0 0.0 291208 7664 ? Sl Jun30 0:00 /usr/lib/policykit-1/polkitd --no-debug

On Friday, I installed updates and then rebooted without logging in. This morning, before logging in, polkitd was already using nearly 1 GB of memory:

$ uptime
 09:09:38 up 3 days, 15:57, 1 user, load average: 0.06, 0.05, 0.05
$ ps aux | grep polkitd | grep -v grep
root 1034 0.4 11.2 1137788 912732 ? Sl Jul02 23:23 /usr/lib/policykit-1/polkitd --no-debug
$ date
Mon Jul 6 09:11:17 EDT 2015

Revision history for this message
bmaupin (bmaupin) wrote :
Download full text (5.6 KiB)

As I mentioned in my last comment, yesterday I logged into my computer after it had been up for 3 days at the login screen. Upon logging in, polkitd was using nearly 1 GB of memory:

$ uptime
 09:09:38 up 3 days, 15:57, 1 user, load average: 0.06, 0.05, 0.05
$ ps aux | grep polkitd | grep -v grep
root 1034 0.4 11.2 1137788 912732 ? Sl Jul02 23:23 /usr/lib/policykit-1/polkitd --no-debug
$ date
Mon Jul 6 09:11:17 EDT 2015

After nearly 8 hours of being logged in, polkitd memory usage had barely gone up:

$ date; uptime; ps aux | grep polkitd | grep -v grep
Mon Jul 6 17:04:42 EDT 2015
 17:04:42 up 3 days, 23:52, 4 users, load average: 0.36, 0.25, 0.26
root 1034 0.4 11.2 1148092 913328 ? Sl Jul02 23:24 /usr/lib/policykit-1/polkitd --no-debug

Then I added some commands to /etc/rc.local to log polkitd memory usage as well as output from dbus-monitor --system, rebooted my machine, and left it at the login prompt. I checked it this morning, after about 16 hours of being left at the login prompt. The output log from dbus-monitor --system was over 100 MB and nearly entirely full of messages like this, with new messages being constantly added:

signal sender=org.freedesktop.DBus -> dest=(null destination) serial=44 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.252082"
   string ":1.252082"
   string ""
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=45 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.252083"
   string ""
   string ":1.252083"
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=46 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.252083"
   string ":1.252083"
   string ""
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=47 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.252084"
   string ""
   string ":1.252084"
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=48 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.252084"
   string ":1.252084"
   string ""

The polkitd memory usage seems to have increased about 10 MB every hour:

Mon Jul 6 17:07:37 EDT 2015
 17:07:37 up 0 min, 0 users, load average: 2.65, 0.71, 0.24
root 1234 0.0 0.0 279764 7748 ? Sl 17:07 0:00 /usr/lib/policykit-1/polkitd --no-debug
Mon Jul 6 18:07:38 EDT 2015
 18:07:38 up 1:00, 0 users, load average: 0.02, 0.02, 0.05
root 1234 0.4 0.2 287188 18908 ? Sl 17:07 0:16 /usr/lib/policykit-1/polkitd --no-debug
Mon Jul 6 19:07:38 EDT 2015
 19:07:38 up 2:00, 0 users, load average: 0.03, 0.05, 0.05
root 1234 0.4 0.3 293920 29112 ? Sl 17:07 0:34 /usr/lib/policykit-1/polkitd --no-debug
Mon Jul 6 20:07:38 EDT 2015
 20:07:38 up 3:00, 0 users, load average: 0.08, 0.03, 0.05
root 1234 0.4 0.4 300784 39328 ? Sl 17:07 0:51 /usr/lib/policykit-1/polkitd --no-debug
Mon Jul 6 21:07:38 EDT 2015
 21:07:38 up 4:00, 0 users, load average: 0.00, 0.01, 0.05
root 1234 ...

Read more...

Revision history for this message
Waffles (eicb-waffles) wrote :

I also have a slowly growing polkitd.

After an uptime of 6d1h /usr/lib/policykit-1/polkitd --no-debug has a CPU time of 6:32:57 and memory usage of 1.3GiB (started around 7MiB at boot).

Of note I've used Transmission the whole time, Firefox on and off, and Duplicity every morning.

Revision history for this message
Jon Dallara (jondallara) wrote :

New screenshots from my system after 5+ days. polkitd is at 1.2G +. I have daily screenshots also if they are needed. I have Firefox and Thunderbird running always. I do find my WIFI connection becomes less stable as polkitd gets larger.

Revision history for this message
Jon Dallara (jondallara) wrote :
Revision history for this message
Jon Dallara (jondallara) wrote :
Revision history for this message
Waffles (eicb-waffles) wrote :

I also have a slowly growing polkitd.

After an uptime of 6d1h /usr/lib/policykit-1/polkitd --no-debug has a CPU time of 6:32:57 and memory usage of 1.3GiB (started around 7MiB at boot).

After a reboot, reading smem every 10 minutes, it appears to be growing 1609MiB/10min. +-5MiB consistently.

Revision history for this message
Waffles (eicb-waffles) wrote :

Sorry, that was 1609 KiB/10min.

3.19.0-20-generic
policykit-1:
  Installed: 0.105-4ubuntu2.14.04.1

Revision history for this message
Jon Dallara (jondallara) wrote :

Just to keep this alive and to add a new data point, I upgraded to the 3.19.0-21 kernel and after 6 days polkitd has grown to 1.4+G memory usage. I don't think the kernel version has anything to do with the problem. On the plus side, my WIFI connection has stabilized since the upgrade.

Thx, Jon.

p.s. I'm putting together a new system so I'll be able to know if this will affect a absolutely clean install in a couple of weeks.

Revision history for this message
Junix (junixbr) wrote :

Just to inform, in my machine polkitd is cosuming almost 3GB.

$ sudo psmem.py | grep polkitd
  2.8 GiB + 190.0 KiB = 2.8 GiB polkitd

Revision history for this message
Jon Dallara (jondallara) wrote :

New system, clean install. Linux Mint 17.2, 3.19-0-21 kernel. Same problem, over 1G in less than 2 days. My older system will lock up thrashing its swap space if I don't re-boot it every 3 days or so (memory used 100% and swap 95-100% used).

Thanks, Jon.

?field.comment=New system, clean install. Linux Mint 17.2, 3.19-0-21 kernel. Same problem, over 1G in less than 2 days. My older system will lock up thrashing its swap space if I don't re-boot it every 3 days or so (memory used 100% and swap 95-100% used).

Thanks, Jon.

Revision history for this message
bmaupin (bmaupin) wrote :

I looked into those dbus messages and didn't find anything helpful. My system is fully up to date and I still have this issue.

Here's my current workaround:

sudo sh -c 'echo "#!/bin/bash

/usr/bin/killall /usr/lib/policykit-1/polkitd" > /etc/cron.daily/kill-polkitd'
sudo chmod +x /etc/cron.daily/kill-polkitd

Revision history for this message
peaceful_lake (peaceful-lake) wrote :

I also have this problem, anybody help!!!

Revision history for this message
Jon Dallara (jondallara) wrote :

Use the script in #16, it's an ugly solution, but it works.

Revision history for this message
peaceful_lake (peaceful-lake) wrote :

Hi,gays! It seems to work fine when I update the kernel to 4.2, it consumes 5.7M RES Memory in an hour with 0 incrementation. Maybe you should try! Good luck!

Revision history for this message
Area42 (area-42) wrote :

Hi there!

I HAD the same problem on 8 different machines (a notebook, 3 nettops, a netbook, and 3 desktops).
OS: 8x Linux Mint 17.2 Cinnamon 32-bit, kernel 3.16.0-38-generic. Polkitd ate up up to 1.7 GB RAM after a while.

My solution: deactivation of the applet 'Multi-Core System Monitor' (http://cinnamon-spices.linuxmint.com/applets/view/79); it was running on each machine. Reboot - all fine so far...

I hope that helps. :)

Revision history for this message
Hasan Yavuz Özderya (hyozd) wrote :

@area-42 I've been in the exact same situation! I confirm that removing 'Multi-Core System Monitor' applet solved the issue.

Revision history for this message
Timo Palomaa (timppis) wrote :

Coicidentally, also I have (had) that applet installed...

Someone already reported this on: https://github.com/ccadeptic23/Multi-Core-System-Monitor/issues/12

Revision history for this message
Travisgevans (travisgevans) wrote :

This happened to me, too. I installed Multi-Core System Monitor for just a moment and noticed the steadily growing memory usage. Worse, removing the applet did not stop the leak. The leak didn't stop until the next system reboot (presumably restarting polkitd would have also worked, but I didn't try it since I wasn't sure how safe it was).

But since there's no way to know if this was the trigger for the original bug report or earlier commenters, perhaps the MCSM case should be opened as a separate, specific bug against policykit?

Revision history for this message
Cho Wooyoung (chowy) wrote :

I'm experiencing the same problem.
Memory consumption of polkitd process is still increasing without Multi-Core System Monitor.
With Multi-Core System Monitor, it increases much faster. I think it must be a memory leak of polkitd.

Revision history for this message
solax (solax76) wrote :

I have Linux Mint 17.3 with Multi-Core System Monitor and the same issue with polkitd process.
I have noticed that removing the Multi-Core applet from the panel and adding it again, causes polkitd to increase the cpu usage. It started with 4%, after one restart to 8%, then another restart to 12% and then 16%.
I have disabled the applet and restarted the system. Now polkitd is at 0% of CPU usage and 7.2Mb of RAM since half hour.

Revision history for this message
Wedge009 (wedge009) wrote :

I have this issue on 17.10 and 18.04 but I'm not sure if it's related to the original reporter's case because for me I suspect it's related to amdgpu-pro. In earlier distributions the memory leak was elsewhere - I can't remember if it was in xorg or plasmashell, though. I *think* it also happened with fglrx, before amdgpu was released, but that was so long ago now I can't be sure.

Regardless, the way I work around this is to restart the polkitd service every now and then. Otherwise, after a few days the memory usage is in the order of *gigabytes*!

Revision history for this message
bmaupin (bmaupin) wrote :

For what it's worth, I don't seem to have had this issue after upgrading to Ubuntu 16.04. I recently just upgraded to 18.04 so I'll continue to keep an eye on things.

Revision history for this message
bmaupin (bmaupin) wrote :

I don't seem to have this issue on 18.04 either, so it seems to be limited to 14.04.

$ ps aux | grep [p]olkit
root 1453 0.0 0.0 292924 8796 ? Ssl Oct12 0:01 /usr/lib/policykit-1/polkitd --no-debug
bmaupin 16637 0.0 0.1 323808 19996 ? Sl 08:10 0:00 /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1

$ lsb_release -rd
Description: Ubuntu 18.04.1 LTS
Release: 18.04

In response to other comments, I never used Multi-Core System Monitor but I've used indicator-multiload ("System Load Indicator") the last 5+ years.

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.