Qbittorrent Memory Leaks

Recommended Posts

I've been having some pretty severe memory leak issues with all three qbittorrent docker containers recently (binhex, hotio and lscr.io).  I transferred ~10,000 torrents (47TB total) and fast resume data from another linux-based (not Unraid) server to my Unraid server.  The previous server that these torrents were running on was rock solid stable for a year and that server used 8GB RAM total (including the OS).  No memory leaks with that Qbit instance (4.3.9 libtorrent v1).


The qbit instance is just seeding (no downloading).  And no matter what I try, the qbit container eats up more and more RAM until it almost locks up the server.  Even when I have zero active torrents, memory usage grows until the docker oom killer reaps it (and resets the qbit app within the container).  For now, I've set a container memory limit of 64GB and that prevents the server itself from running out of RAM, otherwise Qbit will easily eat up all 192GB of RAM before I have to kill it.  


Troubleshooting Steps I've Tried -- no success with any of them:

  • Different containers (lscr.io, Binhex and Hotio) 
  • Different Qbit versions (4.3.9, 4.4.5, 4.6.0, 4.6.2, 4.6.3 and 4.6.4)
  • Different Libtorrent versions (v1 and v2)
  • New Server Hardware (new CPU, Ram, Mobo, HBA)


Server Specs:

  • Supermicro H12SSL-NT
  • EPYC 7B13 - 64 core at 2.20 Ghz
  • 256GB DDR4-3200 ECC RDIMM
  • Memory Allocation:
    • 64GB to ZFS
    • 64GB to troublesome Qbit container
    • The remainder is unallocated


Strangely enough, I have two other active lscr qbit containers (details below) and those containers only uses around 1-4GB of RAM each (depending on activity).  This is all on the same unraid server.  I've also tried endless changes to qbit advanced config options, but nothing helps.


I'm not sure what the problem is, but I've never run across such memory leaks across so many different versions of qbit.  The only constant factor for the memory leaks is this set of torrents and Unraid.  Any suggestions would be greatly appreciated.  Enclosed are my anonymized diagnostics.  


Since these issues persist across every new container I create, I'm unsure if perhaps there's a rogue torrent causing the issue?  I'm completely stumped at this point.


Qbit Instance 1:  1,000 torrents -- seed size 26TB -- no memory issues

Qbit Instance 2: 10,000 torrents -- seed size 63TB -- no memory issues

Qbit Instance 3: 10,000 torrents -- seed size 47TB -- terrible memory leaks (problem child)


Other Config Info (may not be relevant):

Local File Storage for Qbit

  • 16 HDD RAIDZ2 Pool
    • Two VDEVs with 8 HDD each




Edited by dyno
edited for clarity
Link to comment
5 hours ago, Unraidmule said:

I am having the same issue which has not been resolved yet:


RAM leak issue


Did you find a solution?


Not yet, unfortunately.  I posted a thread in the lscr.io Discord server, but they instructed me to make a bug report to qBittorrent.  Since this issue is occurring across containers from three different maintainers.  


I'll probably make a bug report in GitHub today.

Link to comment
11 minutes ago, Unraidmule said:

Are you using any other sort of application which is probing the qBit API? Also my issue only occurred if I stayed on the web UI


I was also instructed the same as you - lscr.io said it wasn't their problem too.

I have WebUI tabs open for all the qbit containers, but that has no impact on server memory usage.  


I have some manual scripts that poll the qBit API, but I only run them occasionally to locate unregistered .torrent files and clean them up.  So that would not cause this either.

Link to comment
21 minutes ago, Unraidmule said:

If you keep the tabs closed, does it fix your issue?


For me, I was calling the API constantly for 3 instances (every 2-3s) while keeping the web UI open, which has a glitch to increase the RAM until server crashes.


No, it has no impact on memory usage.

Link to comment
10 hours ago, Unraidmule said:

Ah OK, if you find a solution can you please post it here

Will do.  

Unfortunately, this appears to be a bug in qBittorrent’s code.  For now, I’d recommend setting a memory limit for your qBit container(s) to prevent it from crashing the server.  

Aside from that, you may want to try Transmission.  For myself, I can live with this for the moment since I have a lot of RAM.  That said, migrating to Transmission is painful and not really feasible for me.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.