Bug 414538 - Memory leak when sending files with KDE Connect
Summary: Memory leak when sending files with KDE Connect
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: common (show other bugs)
Version: 1.3.5
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-26 14:56 UTC by John S.
Modified: 2023-03-23 17:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John S. 2019-11-26 14:56:34 UTC
SUMMARY
Originally reported in the Fedora bugzilla (https://bugzilla.redhat.com/show_bug.cgi?id=1774339) it was recommended that I report this upstream.

When sending large files with KDE Connect, system memory usage increases without a similar decrease once the transfer is complete. After transferring ~80 GiB of files from my laptop to my desktop, my laptop's memory usage was at 14.1 GiB of 15.5 GiB available, with about 13.5 GiB of that being kdeconnectd. Performance slowed to a crawl until I killed the kdeconnectd process.

There was no such effect on the receiving desktop. I tried sending a single 40 GiB file from my desktop to my laptop and it took up 29 GiB of memory during the transfer, then dropped to 13 GiB afterward.

STEPS TO REPRODUCE
1. Pair two computers via KDE Connect
2. Open Dolphin, right click on a large file, and select "Send to '$foo' via KDE Connect"
3. Open ksysguard and watch the memory usage climb

OBSERVED RESULT
Memory usage increases dramatically and doesn't decrease once the transfer is complete.

EXPECTED RESULT
Memory should be freed once the transfer is complete.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux 5.3.11
(available in About System)
KDE Plasma Version: 5.16.5
KDE Frameworks Version: 5.61.0
Qt Version: 5.12.5

ADDITIONAL INFORMATION
Watching this happen in ksysguard, it looks like there are periodic breaks in the file upload. During those breaks, memory usage climbs, at least during the first half of the transfer. It looks like the file is being put into an upload buffer, but the buffer isn't completely cleared once the transfer is complete.
Comment 1 NXiss7 2019-12-07 07:52:55 UTC
I'm having the same issue.
It looks like KDEConnectD preallocates memory as big as the file itself.
This is a problem by itself but moreover, it doesn't release the memory allocated, causing excessive RAM usage.
Comment 2 Albert Vaca Cintora 2023-03-23 17:59:13 UTC
This was fixed a while back. If it's not please reopen.