Bug 1854875

Summary: Possible memory leak in packagekit
Product: Red Hat Enterprise Linux 8 Reporter: Michal Karm Babacek <mbabacek>
Component: PackageKitAssignee: Richard Hughes <rhughes>
Status: CLOSED WONTFIX QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: bugzilla, jvanek, klember, mbabacek, xili, zzambers
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-01-08 07:26:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Karm Babacek 2020-07-08 11:54:39 UTC
Description of problem:
/usr/libexec/packagekitd 's RSS memeory usage on our RHEL 8.3 system grows over time from a couple of hundreds to a couple of thousands megabytes.

Version-Release number of selected component (if applicable):

> $ rpm -qa | grep .ackage.it
> PackageKit-1.1.12-6.el8.x86_64
> cockpit-packagekit-221-1.el8.noarch
> PackageKit-glib-1.1.12-6.el8.x86_64

How reproducible:
Always. Every 3 weeks or so of uptime.

Steps to Reproduce:
1. Start the system
2. Run Java programs, use the system and wait
3. packagekitd's RSS goes through the roof 

Actual results:
PID    PPID   RSS   CMD
1777   1      2072M /usr/libexec/packagekitd

Expected results:
PID    PPID   RSS   CMD
1809   1      233M  /usr/libexec/packagekitd

Additional info:
There seems to be no obvious reason for packagekitd to hold on to so much memory.

There is nothing special in the config:


> $ cat /etc/PackageKit/PackageKit.conf
> # Only the system administrator should modify this file, ordinary users
> # should not have to change anything.
> 
> [Daemon]
> 
> # Default backends, as chosen in the configure script. This will be used
> # where no --backend="foo" option is given to the daemon.
> #
> # The order they are specified is the order they are tried, so for the
> # value "foo,bar" first "foo" will be attempted and then "bar" if the
> # libpk_backend_foo.so module load failed.
> #DefaultBackend=auto
> 
> # Unlock the backend after this many seconds idle.
> #BackendShutdownTimeout=5
> 
> # Shut down the daemon after this many seconds idle. 0 means don't shutdown.
> #ShutdownTimeout=300
> 
> # Keep the packages after they have been downloaded
> #KeepCache=false

Comment 1 Richard Hughes 2020-09-21 07:46:56 UTC
Can you outline a way to reproduce this please? I obviously don't see the kind of memory usage here. Thanks.

Comment 2 Michal Karm Babacek 2020-09-24 10:46:54 UTC
Hi Richard,

It might sound silly, but I really haven't done anything besides the aforementioned:

Steps to Reproduce:
1. Start the system
2. Run Java programs, use the system and wait
3. packagekitd's RSS goes through the roof 

@Jiri Vanek: How is the system doing these days? Do we restart it regularly to workaround it or did recent updates fix it?

Comment 3 jiri vanek 2020-09-24 13:46:29 UTC
The machine is geerting regualr updates, but I thin you have disabled the service as the result, havent you?
On hel (el 8.3 pre), Linux hel.brq.redhat.com 4.18.0-232.el8.x86_64 #1 SMP Mon Aug 10 06:55:47 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux:
    PID     TID CLS RTPRIO STAT    VSZ   RSS COMMAND
   1811    1811 TS       - Ssl  461876  5144 packagekitd

On helson (8.2 updated), the process is not running.
Linux helson.tpb.lab.eng.brq.redhat.com 4.18.0-147.5.1.el8_1.x86_64 #1 SMP Tue Jan 14 15:50:19 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

The reboot of machines was aprox month or two ago.

Comment 5 XinhuaLi 2021-02-22 01:49:48 UTC
Hi 

Good day.
I can see similar behavior against RHEL 8.2/8.3; however, i do not know the reproduce procedure.

- 1, RHEL 8.3
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
root        3705  0.0 17.3 7874628 7036612 ?     Ssl  Jan10  27:39 /usr/libexec/packagekitd
-------------------------------------------------------------------------------------
PackageKit-1.1.12-6.el8.x86_64

Red Hat Enterprise Linux release 8.3 (Ootpa)

4.18.0-240.10.1.el8_3.x86_64 #1 SMP Wed Dec 16 03:30:52 EST 2020 x86_64 x86_64 x86_64 GNU/Linux

# uptime 
08:47:24 up 42 days, 12:17,  2 users,  load average: 4.27, 3.98, 3.39
-------------------------------------------------------------------------------------

- 2, RHEL 8.2
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
root        4036  3.9  2.8 676876 137248 ?       Ssl  08:55   0:03 /usr/libexec/packagekitd
-------------------------------------------------------------------------------------
PackageKit-1.1.12-4.el8.x86_64

Red Hat Enterprise Linux release 8.2 (Ootpa)

4.18.0-193.el8.x86_64 #1 SMP Fri Mar 27 14:35:58 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

# uptime 
09:04:34 up  1:39,  3 users,  load average: 0.02, 0.12, 0.08
-------------------------------------------------------------------------------------

Regards
Sam

Comment 6 Chris Murphy 2021-03-27 18:20:50 UTC
See also bug 1896964.

Comment 7 Richard Hughes 2021-10-05 11:09:23 UTC
If you log the heap using valgrind, is it PackageKit that's consuming such a huge amount of RSS, or a library that it's using? e.g. libdnf for instance?

Comment 9 RHEL Program Management 2022-01-08 07:26:59 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 10 Red Hat Bugzilla 2023-09-15 00:34:01 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days