Packagekitd eating RAM, CPU

Bug #1249343 reported by Antti Haapala
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
packagekit (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Since updating to saucy, packagekitd seems to eat all my memory, turning computer sluggish. If I kill it it respawns soon and quickly eats half the RAM. I have seen even seen VM size > 10G, with resident set sizes of 1-3G, way too much for a computer with 4G of RAM.

I do not know how to debug the issue; however looking at the /proc/pid/fd shows something even more dubious, there are 578 open file descriptors to files in /var; all apt-lists and /var/lib/dpkg/status are opened with 12 filedescriptors? Also, /var/cache/apt/pkgcache.bin seems to be memmapped quite some many times:

7f3b660c6000-7f3b68494000 rw-p 00000000 fc:08 1246201 /var/cache/apt/pkgcache.bin
7f3b68c95000-7f3b6b063000 rw-p 00000000 fc:08 1246201 /var/cache/apt/pkgcache.bin
7f3b6b864000-7f3b6dc32000 rw-p 00000000 fc:08 1246201 /var/cache/apt/pkgcache.bin
7f3b6dc32000-7f3b70000000 rw-p 00000000 fc:08 1246201 /var/cache/apt/pkgcache.bin
7f3b744f9000-7f3b768c7000 rw-p 00000000 fc:08 1246201 /var/cache/apt/pkgcache.bin
7f3b79496000-7f3b7b864000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3b7b864000-7f3b7dc32000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3b7dc32000-7f3b80000000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3b85c32000-7f3b88000000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3b8c928000-7f3b8ecf6000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3b928c7000-7f3b94c95000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3b95496000-7f3b97864000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3b97864000-7f3b99c32000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3b99c32000-7f3b9c000000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3ba08c3000-7f3ba2c91000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3ba6862000-7f3ba8c30000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3ba9431000-7f3bab7ff000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3bb02f0000-7f3bb26be000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3bb26be000-7f3bb4a8c000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3bb4a8c000-7f3bb6e5a000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3bbb0cf000-7f3bbd49d000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3bbe342000-7f3bc0710000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3bc15b5000-7f3bc3983000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3bc4828000-7f3bc6bf6000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)
7f3bc7864000-7f3bc9c32000 rw-p 00000000 fc:08 1245278 /var/cache/apt/pkgcache.bin (deleted)

----

Description: Ubuntu 13.10
Release: 13.10

packagekit:
  Installed: 0.8.10-2ubuntu2
  Candidate: 0.8.10-2ubuntu2
  Version table:
 *** 0.8.10-2ubuntu2 0
        500 http://se.archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Quinn Balazs (qbalazs) wrote :

If you would, please collect memory forensics using valgrind. Use the instructions here: https://wiki.ubuntu.com/Valgrind, and post the resultant valgrind.log(s). After this has been done and uploaded, set the status here back to new and someone will take a look at it.

Thanks,
Quinn Balazs

Changed in packagekit (Ubuntu):
status: New → Incomplete
Revision history for this message
Antti Haapala (ztane) wrote :

Here is the valgrind log; I wrapped the packagekitd with a shell script wrapper.

The process seems to have died/finished many times over the day by itself, but now at 23:08 it shows

root 24963 85.8 65.9 6955452 2670212 ? Sl 20:41 124:44 /usr/bin/valgrind.bin -v --tool=memcheck --leak-check=full --num-callers=40 --log-file=/tmp/valgrind.log /usr/lib/packagekit/packagekitd.real

-> Killed.

Revision history for this message
Antti Haapala (ztane) wrote :
Revision history for this message
Antti Haapala (ztane) wrote :
Changed in packagekit (Ubuntu):
status: Incomplete → New
Quinn Balazs (qbalazs)
Changed in packagekit (Ubuntu):
status: New → Confirmed
Revision history for this message
Quinn Balazs (qbalazs) wrote :

Sorry it's taken me a bit to get around to looking through the logs. Something does seem a bit strange, so on that basis this is confirmed. I'm going to take a look at them today, and should have some idea of what is going on a bit later.

Revision history for this message
PJW (peter-isoc) wrote :

Today I noticed the packagekitid process using more than 12% CPU
Had to kill it to get my system up to speed again.

I have the distinct impression there is an interference with Firefox somewhere.

Revision history for this message
Matthias Klumpp (ximion) wrote :

This should be resolved and since 1.2.6 the daemon will even shutdown again when not in use.

Changed in packagekit (Ubuntu):
status: Confirmed → Fix Released
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.