transmission-daemon high RAM usage

Bug #1973084 reported by aramaicus
78
This bug affects 14 people
Affects Status Importance Assigned to Milestone
transmission (Debian)
Confirmed
Unknown
transmission (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned
Lunar
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

There is a memory leak in transmission-daemon that was introduced by a faulty openssl3 patch. It has been reported that it's noticeable after a few hours of seeding/downloading torrent files, less than a day.

[ Test Plan ]

Being a memory leak, there is no immediate/quick test that can be performed, other than letting it run for a few hours and measure memory consumption "before" and "after". comment #5 mentions about 1Gb of RAM after 18h of runtime. #comment 14 mentions 12Gb of RAM, but not for how long it was running.

comment #20 says that after 24h using the patched version from a PPA build, the memory consumption was steady at 300Mb.

I'd suggest a 24h test and that it should stay under 1Gb of RAM.

[ Where problems could occur ]

The patch loads the default and legacy openssl3 providers. This will potentially change the set of algorithms available to the application, compared to what was there before. That being said, the legacy provider is a conservative approach, and the likely result is that *more* algorithms will become available, and not less. This is also the approach I have seen in other applications that were rebuilt using openssl3 instead of openssl1.1.

It does seem safer than the original patch, which was manually handling ciphers, in particular RC4, and, well, introduced the memory leak.

[ Other Info ]

Patch came from gentoo.

[ Original Description ]
Transmission uses a lot of RAM in ubuntu 22.04 server (arm64) runnign on a Raspberry Pi 4.

It "eats" RAM and the RAM usage grows each hour until it crashes the system.

I sideloaded transmission-daemon and its dependancies from debian 11 (arm64) locked the packages so apt won't update them and, ever since, this issue hasn't happened.

Description: Ubuntu 22.04 LTS
Release: 22.04

Revision history for this message
aramaicus (aramaicus) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report. Could you re-install the Ubuntu version, trigger the issue and then attach the 'journalctl -b 0' log from the session to the report? Is it triggering on a specific torrent?

Changed in transmission (Ubuntu):
status: New → Incomplete
Revision history for this message
aramaicus (aramaicus) wrote :

It's not triggered by any special torrent file. Right now I am seeding Ubuntu 22.04's files.

Here is the log you asked me.

Right now the whole system is using almost 1GB of RAM (normally it uses 200MB~300MB).

Its uptime is about 18 hours.

Changed in transmission (Ubuntu):
status: Incomplete → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in transmission (Ubuntu):
status: New → Confirmed
Revision history for this message
Sandor Fodor (alexander.curl) wrote :

This issue is still available in x86_64 build also.
Fixed in upstream, but consume more CPU now than it should.

https://github.com/transmission/transmission/issues/3536

https://github.com/transmission/transmission/issues/3494

Revision history for this message
Andrew (caeci11iusad1) wrote :

Confirmed happening in x86_64 build (and has been for at least six months, under both 22.04 and 22.10...though it was fine at some point in the past as I used it successfully for many years with no issue. Please, please, please fix (even if the solution is giving us some mechanism to upgrade to the 4.0 beta via PPA or something (as the commits mention several fixes to memory leaks)...this has been driving me nuts!

No specific torrent, reboot or restart fixes issue (temporarily).

Transmission 3.00 (bb6b5a062e).
51 files seeding (currently), though it doesn't seem sensitive to the number.
16MB disk cache. Max 240 peers.
Tried disabling PEX, DHT and LPD to see if that would help as I don't particularly need them anyway (but it doesn't help).

Revision history for this message
micsu (micsu-z) wrote :

There are many tickets about this memory leak:
https://github.com/transmission/transmission/issues/3055
https://github.com/transmission/transmission/issues/3494
https://github.com/transmission/transmission/issues/3536

The issue has been already fixed, but we have to wait for the next release,
or we can install the nightly builds as recommended by ckerr.
1) install prerequirements:
sudo apt-get update
sudo apt install build-essential cmake libcurl4-openssl-dev libssl-dev curl
2) download latest tarball from https://build.transmissionbt.com/job/trunk-linux/
3) build
tar xf transmission-4.0.0-beta.1.dev+rd381939267.tar.xz
cd transmission-4.0.0-beta.1.dev+rd381939267
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make
sudo make install

The "make" step took an hour on my ten yrs old laptop.
Official description at
https://github.com/transmission/transmission/blob/main/docs/Building-Transmission.md

Revision history for this message
Andrey Kudinov (elhana) wrote (last edit ):

I'm not comfortable with make install.

It seems to be caused by openssl3 patch. I reverted it and used gentoo openssl3 patch, transmission is under 122Mb now instead of 10s of gigabytes.

https://gitweb.gentoo.org/repo/gentoo.git/tree/net-p2p/transmission/files/transmission-3.00-openssl-3.patch

You can try this ppa: https://launchpad.net/~elhana/+archive/ubuntu/ppa-elhana
I've just enabled arm64 build on ppa (apparently you can now).

Revision history for this message
Andrew (caeci11iusad1) wrote :

Noting 4.0.1 stable has now been released, perhaps we could have an update to fix this issue now (if not in 22.10, perhaps in 23.04?).

Revision history for this message
lan (lan-libero) wrote :

Same problem, is possible to have an update to fix this problem?
Thx

Revision history for this message
aramaicus (aramaicus) wrote : Re: [Bug 1973084] Re: transmission-daemon high RAM usage

It's possible to sideload the debian package and its dependencies.

I did it before reporting this bug and it has been working flawlessly.

Not the perfect solution but the solution that is avaliable.

Don't forget to lock the package and dependencies using apt-mark,
otherwise, it will get upgraded and the bug will return.

On Sun, Mar 12, 2023, 15:15 lan <email address hidden> wrote:

> Same problem, is possible to have an update to fix this problem?
> Thx
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1973084
>
> Title:
> transmission-daemon high RAM usage
>
> Status in transmission package in Ubuntu:
> Confirmed
>
> Bug description:
> Transmission uses a lot of RAM in ubuntu 22.04 server (arm64) runnign
> on a Raspberry Pi 4.
>
> It "eats" RAM and the RAM usage grows each hour until it crashes the
> system.
>
> I sideloaded transmission-daemon and its dependancies from debian 11
> (arm64) locked the packages so apt won't update them and, ever since,
> this issue hasn't happened.
>
>
> Description: Ubuntu 22.04 LTS
> Release: 22.04
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/transmission/+bug/1973084/+subscriptions
>
>

Revision history for this message
Lem (lem-jjr) wrote :

I caught transmission-daemon using 12Gb (!) of RAM on my AMD64 system recently, and for what it's worth, the Transmission 4.0.2 packages from UbuntuHandbook PPA fix this issue. I'd noticed 3.0.0 using insane amounts of RAM many times before (workaround was to restart the daemon), but seeing it use 12Gb really made me look for a newer version. Version 4.0.2 uses <200mb with the same torrents.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

The memory leak makes transmission unusable, so this bug should qualify for a SRU. All we need is for someone to prepare a debdiff and request sponsorship for the upload, as described in https://wiki.ubuntu.com/StableReleaseUpdates

Revision history for this message
Marius Gedminas (mgedmin) wrote :

I backported Andrey Kudinov's suggested change (replacing Ubuntu's openssl3-compat.patch with gentoo's version) and built a transmission package in a PPA for jammy (Andrey's PPA only has packages for kinetic and lunar).

I've been testing the patched transmission-gtk for the last 24 hours and the memory leak is gone.

I'm attaching a debdiff.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "debdiff that replaces mem-leaky ubuntu openssl3 patch with the gentoo openssl3 patch" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Changed in transmission (Debian):
status: Unknown → New
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Marius, Andrey

thanks for your contribution!

I uploaded jammy and lunar packages to this ppa[1], with amd64 and arm64 builds, with the gentoo patch replacing the one we had in the package.

Marius, I changed the d/changelog text a bit, I hope you don't mind, but please let me know if you have concerns. I want to make sure to give credit to everybody involved, and keep your name in the changelog entry so this upload goes to you when it's sponsored.

The PPAs are a bit slow, since we just opened the next ubuntu release (noble) for development, so give them some time.

Here are the branches from which I built these packages:

- jammy: https://code.launchpad.net/~ahasenack/ubuntu/+source/transmission/+git/transmission/+ref/jammy-transmission-memleak-1973084
- lunar: https://code.launchpad.net/~ahasenack/ubuntu/+source/transmission/+git/transmission/+ref/lunar-transmission-memleak-1973084

Mantic and later are at version 4.0.2, and focal and earlier are at 2.94, so I believe they are not affected. The problematic openssl3 patch is in neither.

If these work for you guys, then we can start preparing for an SRU, which would definitely be worth it.

1. https://launchpad.net/~ahasenack/+archive/ubuntu/transmission-memleak-1973084/

Revision history for this message
Paride Legovini (paride) wrote :

Hi Marius, Andrey, Lem and other affected users. Please consider testing the package from the PPA that Andreas prepared. This definitely looks like SRU material, but we need some kind of verification before proceeding. Thanks!

Revision history for this message
Lem (lem-jjr) wrote :

Hi Paride, after more than 24 hours running transmission-daemon from Andreas' PPA linked in #18, memory usage is only 300mb. More torrents than when my initial comment (#14) was posted, so I'd say it's fixed.
Thanks to everyone who put the effort in to sort this out.

description: updated
description: updated
Revision history for this message
Andreas Hasenack (ahasenack) wrote (last edit ):

Sponsored for jammy and lunar. Mantic has 4.0 which is not affected.

Unsubscribing sponsors.

Changed in transmission (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello aramaicus, or anyone else affected,

Accepted transmission into lunar-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/transmission/3.00-2.1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-lunar to verification-done-lunar. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-lunar. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in transmission (Ubuntu Lunar):
status: New → Fix Committed
tags: added: verification-needed verification-needed-lunar
Changed in transmission (Ubuntu Jammy):
status: New → Fix Committed
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello aramaicus, or anyone else affected,

Accepted transmission into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/transmission/3.00-2ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed-jammy
Revision history for this message
Chuck H (tgkxyz) wrote :

I was also experiencing the memory leak / crash issue and the proposed package appears to have corrected it along with running stable for over 72 hours now. I've performed a variety of actions such as verifying files and downloading large torrents (>300GB) with many peers. I'm on latest jammy. I think it's okay to push to release.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Hello Chuck,

thanks for the verification. Can you please confirm the package version? The output of the command below is enough:

apt-cache policy transmission-daemon

Revision history for this message
Chuck H (tgkxyz) wrote :

Sure here is the output:

root@gw:~# apt-cache policy transmission-daemon
transmission-daemon:
  Installed: 3.00-2ubuntu2.1
  Candidate: 3.00-2ubuntu2.1
  Version table:
 *** 3.00-2ubuntu2.1 100
        100 /var/lib/dpkg/status
     3.00-2ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages

Jeremy Bícha (jbicha)
tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Robie Basak (racb) wrote :

Could someone also test the proposed fix for Lunar please, and report the version tested? Otherwise releasing the fix for Jammy will result in users being regressed if upgrading from Jammy to Lunar.

Revision history for this message
Chuck H (tgkxyz) wrote :

All good for over 24 hours with Lunar on the proposed package. I tested it with the Ubuntu Server LTS 22.04 torrent and had at least a few encrypted connections. Memory was stable throughout.

@ubuntu-2304-test:~$ apt-cache policy transmission-daemon
transmission-daemon:
  Installed: 3.00-2.1ubuntu0.1
  Candidate: 3.00-2.1ubuntu0.1
  Version table:
 *** 3.00-2.1ubuntu0.1 100
        100 /var/lib/dpkg/status
     3.00-2.1build1 500
        500 http://us.archive.ubuntu.com/ubuntu lunar/universe amd64 Packages

Robie Basak (racb)
tags: added: verification-done verification-done-lunar
removed: verification-needed verification-needed-lunar
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package transmission - 3.00-2.1ubuntu0.1

---------------
transmission (3.00-2.1ubuntu0.1) lunar; urgency=medium

  [ Andrey Kudinov ]
  * Replace openssl 3 compatibility patch to fix memory leak (LP: #1973084):
    - d/p/openssl3-compat.patch: dropped
    - d/p/transmission-3.00-openssl-3.patch: patch from Gentoo that enabled the
      legacy provider in OpenSSL3, which restores RC4

 -- Marius Gedminas <email address hidden> Tue, 24 Oct 2023 08:55:57 +0300

Changed in transmission (Ubuntu Lunar):
status: Fix Committed → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Update Released

The verification of the Stable Release Update for transmission has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

This bug was fixed in the package transmission - 3.00-2ubuntu2.1

---------------
transmission (3.00-2ubuntu2.1) jammy; urgency=medium

  [ Andrey Kudinov ]
  * Replace openssl 3 compatibility patch to fix memory leak (LP: #1973084):
    - d/p/openssl3-compat.patch: dropped
    - d/p/transmission-3.00-openssl-3.patch: patch from Gentoo that enabled the
      legacy provider in OpenSSL3, which restores RC4

 -- Marius Gedminas <email address hidden> Tue, 24 Oct 2023 08:55:57 +0300

Changed in transmission (Ubuntu Jammy):
status: Fix Committed → Fix Released
Changed in transmission (Debian):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.