Bug 1896964 - PackageKit uses too much RAM when idle
Summary: PackageKit uses too much RAM when idle
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: PackageKit
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard Hughes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1857819 1867435 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-11 23:09 UTC by Chris Murphy
Modified: 2023-04-28 00:06 UTC (History)
18 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-04-28 00:06:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github hughsie PackageKit issues 286 0 None open packagekitd get-updates loop causes constant CPU activity and high memory usage 2020-11-25 20:04:53 UTC

Description Chris Murphy 2020-11-11 23:09:14 UTC
Description of problem:

PackageKit uses 300M-900M RAM when idle. Service restart temporarily alleviates the problem. Possible memory leak.

Version-Release number of selected component (if applicable):
PackageKit-1.2.1-1.fc33.x86_64

How reproducible:
Always


Steps to Reproduce:
1. Clean install, e.g. 
2.
3.

Actual results:

Immediately after g-i-s completes

root        1097  1.3  2.5 826400 102576 ?       Ssl  15:46   0:05 /usr/libexec/packagekitd


Do nothing for 5 minutes, and check again

root        1097 13.0  8.6 995080 346688 ?       Ssl  15:46   1:35 /usr/libexec/packagekitd


[root@localhost 1097]# cat status
Name:	packagekitd
Umask:	0022
State:	S (sleeping)
Tgid:	1097
Ngid:	0
Pid:	1097
PPid:	1
TracerPid:	0
Uid:	0	0	0	0
Gid:	0	0	0	0
FDSize:	256
Groups:	 
NStgid:	1097
NSpid:	1097
NSpgid:	1097
NSsid:	1097
VmPeak:	 1244276 kB
VmSize:	  995080 kB
VmLck:	       0 kB
VmPin:	       0 kB
VmHWM:	  432652 kB
VmRSS:	  346692 kB
RssAnon:	  322956 kB
RssFile:	   23736 kB
RssShmem:	       0 kB
VmData:	  373508 kB
VmStk:	     132 kB
VmExe:	     160 kB
VmLib:	   21560 kB
VmPTE:	     832 kB
VmSwap:	     508 kB
HugetlbPages:	       0 kB
CoreDumping:	0
THP_enabled:	1
Threads:	3
SigQ:	4/15528
SigPnd:	0000000000000000
ShdPnd:	0000000000000000
SigBlk:	0000000000000000
SigIgn:	0000000000001000
SigCgt:	0000000180000002
CapInh:	0000000000000000
CapPrm:	000000ffffffffff
CapEff:	000000ffffffffff
CapBnd:	000000ffffffffff
CapAmb:	0000000000000000
NoNewPrivs:	0
Seccomp:	0
Speculation_Store_Bypass:	thread vulnerable
Cpus_allowed:	f
Cpus_allowed_list:	0-3
Mems_allowed:	00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
Mems_allowed_list:	0
voluntary_ctxt_switches:	2317
nonvoluntary_ctxt_switches:	2005



Expected results:

This amount of memory consumption seems unreasonable. At the least, these are dirty pages that need to be evicted. Or maybe it's a memory leak and unintended.

Additional info:


On a "production" laptop, packagekit is never using less than 350M RAM.

root      117999  0.1  4.6 1026344 370612 ?      Ssl  Nov10   2:00 /usr/libexec/packagekitd


And after a few days uptime, it will consistently use more than 900M, essentially none of that are dirty pages. So it really is hogging memory unreasonably, and forcing other things to be evicted when free memory starts to run low.

Comment 1 Chris Murphy 2020-11-11 23:10:46 UTC
If I 'systemctl restart packagekit' the new process consumes about 25MiB for at least 5 minutes. And then seemingly after a repository cache update, this grows > 300 MiB and isn't ever released,  it only grows from there.

Comment 2 Richard Hughes 2020-11-12 11:41:33 UTC
I guess that's the DnfContext, although I'm not really sure. 25MiB seems like more what I'd expect for packagekid, although even that seems an order of magnitude more than what I'd want. Does the RSS blow up if you select a different backend? e.g. sudo /usr/libexec/packagekitd --backend=dummy

Comment 3 Chris Murphy 2020-11-12 17:51:22 UTC
root        9384  0.0  0.1 262320  9072 pts/1    S+   10:43   0:00 sudo /usr/libexec/packagekitd --backend=dummy
root        9386  0.0  0.1 538404 11052 pts/1    Sl+  10:43   0:00 /usr/libexec/packagekitd --backend=dummy

So, quite a lot less.

Comment 4 Chris Murphy 2020-11-12 18:24:53 UTC
For what it's worth, this is not a new problem, I see it in Fedora 31 also. 

PackageKit-1.1.12-11.fc31.x86_64

Clean install, reboot, and within 5 minutes of uptime and following completion of g-i-s:

root        1095 64.1 15.5 1296972 625480 ?      Ssl  11:17   3:29 /usr/libexec/packagekitd

That's 15% of installed RAM with our recommended system requirements, and 30% with the minimum system requirement.

Comment 5 Chris Murphy 2020-11-12 18:32:38 UTC
Both of these are on Fedora 31, but the behavior is the same on Fedora 32 and 33. These are taken 10 minutes uptime.

# cat /proc/1095/status
Name:	packagekitd
Umask:	0022
State:	S (sleeping)
Tgid:	1095
Ngid:	0
Pid:	1095
PPid:	1
TracerPid:	0
Uid:	0	0	0	0
Gid:	0	0	0	0
FDSize:	128
Groups:	 
NStgid:	1095
NSpid:	1095
NSpgid:	1095
NSsid:	1095
VmPeak:	 1446396 kB
VmSize:	 1277444 kB
VmLck:	       0 kB
VmPin:	       0 kB
VmHWM:	  719632 kB
VmRSS:	  624760 kB
RssAnon:	  601776 kB
RssFile:	   22984 kB
RssShmem:	       0 kB
VmData:	  668180 kB
VmStk:	     132 kB
VmExe:	     208 kB
VmLib:	   21468 kB
VmPTE:	    1428 kB
VmSwap:	    2900 kB
HugetlbPages:	       0 kB
CoreDumping:	0
THP_enabled:	1
Threads:	3
SigQ:	4/15567
SigPnd:	0000000000000000
ShdPnd:	0000000000000000
SigBlk:	0000000000000000
SigIgn:	0000000000001000
SigCgt:	0000000180000002
CapInh:	0000000000000000
CapPrm:	0000003fffffffff
CapEff:	0000003fffffffff
CapBnd:	0000003fffffffff
CapAmb:	0000000000000000
NoNewPrivs:	0
Seccomp:	0
Speculation_Store_Bypass:	thread vulnerable
Cpus_allowed:	f
Cpus_allowed_list:	0-3
Mems_allowed:	00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
Mems_allowed_list:	0
voluntary_ctxt_switches:	4774
nonvoluntary_ctxt_switches:	12447



chris       1736  2.1  5.1 1327320 205368 ?      Sl   11:18   0:13 /usr/bin/gnome-software --gapplication-service

# cat /proc/1736/status
Name:	gnome-software
Umask:	0022
State:	S (sleeping)
Tgid:	1736
Ngid:	0
Pid:	1736
PPid:	1474
TracerPid:	0
Uid:	1000	1000	1000	1000
Gid:	1000	1000	1000	1000
FDSize:	256
Groups:	10 1000 
NStgid:	1736
NSpid:	1736
NSpgid:	1474
NSsid:	1474
VmPeak:	 1376496 kB
VmSize:	 1327320 kB
VmLck:	       0 kB
VmPin:	       0 kB
VmHWM:	  221896 kB
VmRSS:	  205368 kB
RssAnon:	  169184 kB
RssFile:	   35680 kB
RssShmem:	     504 kB
VmData:	  225644 kB
VmStk:	     132 kB
VmExe:	     576 kB
VmLib:	   37852 kB
VmPTE:	     628 kB
VmSwap:	       0 kB
HugetlbPages:	       0 kB
CoreDumping:	0
THP_enabled:	1
Threads:	4
SigQ:	0/15567
SigPnd:	0000000000000000
ShdPnd:	0000000000000000
SigBlk:	0000000000000000
SigIgn:	0000000000001000
SigCgt:	0000000180000000
CapInh:	0000000000000000
CapPrm:	0000000000000000
CapEff:	0000000000000000
CapBnd:	0000003fffffffff
CapAmb:	0000000000000000
NoNewPrivs:	0
Seccomp:	0
Speculation_Store_Bypass:	thread vulnerable
Cpus_allowed:	f
Cpus_allowed_list:	0-3
Mems_allowed:	00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
Mems_allowed_list:	0
voluntary_ctxt_switches:	15342
nonvoluntary_ctxt_switches:	1784

Comment 6 Chris Murphy 2020-11-12 20:28:49 UTC
Checking back on F31 after 2 hours uptime, packagekitd is not running at all. And gnome-software is still running (in the background) consuming 210M. Let me know if these are possibly related, or if the gnome-software case needs a separate bug report.

Comment 7 Chris Murphy 2020-11-13 04:05:41 UTC
F33 after 6 hours uptime. Terminal is the only application launched.

chris       2181  0.0  4.2 1115640 169824 ?      Sl   15:01   0:06 /usr/bin/gnome-software --gapplication-service
root        2381  0.2  8.8 1024596 353976 ?      Ssl  15:01   0:44 /usr/libexec/packagekitd

Comment 8 Adam Williamson 2020-11-16 16:29:01 UTC
FWIW, on my Rawhide desktop that's been up for some time, packagekitd shows 1806M virt / 1230m res in htop. So yeah, a lot.

Comment 9 Christian Stadelmann 2020-11-17 17:17:12 UTC
Same here. On a system low on RAM I disabled packagekitd for that reason – this is of course not what the Desktop designers want :-P

Comment 10 Chris Murphy 2020-11-25 20:42:33 UTC
*** Bug 1867435 has been marked as a duplicate of this bug. ***

Comment 11 Chris Murphy 2020-11-25 20:46:06 UTC
*** Bug 1857819 has been marked as a duplicate of this bug. ***

Comment 12 Ben Cotton 2021-11-04 13:40:07 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 13 Ben Cotton 2021-11-04 14:09:41 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 14 Ben Cotton 2021-11-04 15:06:43 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 15 Adam Williamson 2021-11-04 22:00:21 UTC
at 1112M virt / 472M res on Rawhide RN. Still seems like a lot.

Comment 16 Ben Cotton 2022-02-08 21:33:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 17 Chris Murphy 2022-02-25 19:12:17 UTC
It's not as bad in F36, but 400M for a background program with file backed cache for exactly this purpose is too high still.

[root@f36 ~]# cat /proc/1068/smaps_rollup
55da85317000-7ffebc8b7000 ---p 00000000 00:00 0                          [rollup]
Rss:              187348 kB
Pss:              169682 kB
Pss_Anon:         163200 kB
Pss_File:           6482 kB
Pss_Shmem:             0 kB
Shared_Clean:      19116 kB
Shared_Dirty:          0 kB
Private_Clean:      5032 kB
Private_Dirty:    163200 kB
Referenced:       187348 kB
Anonymous:        163200 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
FilePmdMapped:         0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:                0 kB

Comment 18 starsiegeplayer 2022-06-26 06:54:29 UTC
On my Fedora 34 system, packagekitd will slowly leak memory, with multiple gigabytes consumed after a few days.   Swap ends up becoming very full, and the computer has problems with things being swapped in and out.  After several days this is a severe performance problem and requires a reboot. 

smem -s swap -r|less run as root shows packagekitd is using gigabytes of swap memory.

Systemctl stop packagekit will only return a relatively small amount of memory.  Only a reboot really fixes the memory leak.

Systemctl disable packagekit keeps packagekitd from running.  When this is done, the memory leak will not occur.   

I have had F34 installed on this computer for over a year and the behavior only started about a couple months ago.

Comment 19 Fedora Update System 2023-01-23 23:06:44 UTC
FEDORA-2023-6c1c40d160 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-6c1c40d160

Comment 20 Ben Cotton 2023-04-25 18:27:03 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 21 Adam Williamson 2023-04-28 00:06:44 UTC
This should be addressed as of current Rawhide and F38, by https://src.fedoraproject.org/rpms/PackageKit/c/bd2bbf1a08ea2b887033b2a16a22e30615bb2a12?branch=f38 . we intentionally didn't backport that to F37 and earlier, though, as it's a fairly significant change.


Note You need to log in before you can comment on or make changes to this bug.