qBt does not free up memory used for cache #6716

Closed
opened 2026-02-21 18:34:27 -05:00 by deekerman · 12 comments
Owner

Originally created by @K7and on GitHub (Jan 4, 2018).

Please provide the following information

qBittorrent version and Operating System

qBT 4.0.3 x64, W7 64

What is the problem

Once qBT reaching maximum disk cache size, amount of memory consumed by process does not go down, even if qBt won't seed more than 100kbps for a long period of time.
Say, if disk cache is 2048MB, then process will not use less than that. Cache expiry interval - 120s

What is the expected behavior

Memory footprint should reduce after download and active seeding is over (and that's what was happening in 3.x line).

Steps to reproduce

Start qbittorrent and wait :)

Originally created by @K7and on GitHub (Jan 4, 2018). **Please provide the following information** ### qBittorrent version and Operating System qBT 4.0.3 x64, W7 64 ### What is the problem Once qBT reaching maximum disk cache size, amount of memory consumed by process does not go down, even if qBt won't seed more than 100kbps for a long period of time. Say, if disk cache is 2048MB, then process will not use less than that. Cache expiry interval - 120s ### What is the expected behavior Memory footprint should reduce after download and active seeding is over (and that's what was happening in 3.x line). ### Steps to reproduce Start qbittorrent and wait :)
Author
Owner

@MPW1412 commented on GitHub (May 20, 2018):

I'm having issues with memory consumption in 4.1 aswell, running on Linux. Sooner or later qBT will be terminated by kernel because memory is up.

@MPW1412 commented on GitHub (May 20, 2018): I'm having issues with memory consumption in 4.1 aswell, running on Linux. Sooner or later qBT will be terminated by kernel because memory is up.
Author
Owner

@Seeker2 commented on GitHub (May 20, 2018):

Are you running the 32 or 64 bit version of qBitTorrent?
Is qBitTorrent reaching roughly 2048 MB ram used before being terminated?

@Seeker2 commented on GitHub (May 20, 2018): Are you running the 32 or 64 bit version of qBitTorrent? Is qBitTorrent reaching roughly 2048 MB ram used before being terminated?
Author
Owner

@MPW1412 commented on GitHub (May 20, 2018):

64 bit in a virtual machine. qBT is the only process running and consumes up to 3 GB of memory. I set the memory to 6 GB now. For now it's stable at around 250 MB plus about 5 GB of caching. But we'll see. The 3 GB before hadn't been enough.

@MPW1412 commented on GitHub (May 20, 2018): 64 bit in a virtual machine. qBT is the only process running and consumes up to 3 GB of memory. I set the memory to 6 GB now. For now it's stable at around 250 MB plus about 5 GB of caching. But we'll see. The 3 GB before hadn't been enough.
Author
Owner

@FranciscoPombal commented on GitHub (May 20, 2018):

How much memory for cache usage do you have set in the settings? In my experience setting it to default yields the best results.

image

@FranciscoPombal commented on GitHub (May 20, 2018): How much memory for cache usage do you have set in the settings? In my experience setting it to default yields the best results. ![image](https://user-images.githubusercontent.com/17580742/40280860-469a4a1a-5c51-11e8-9dd5-3d04590d90f2.png)
Author
Owner

@Seeker2 commented on GitHub (May 20, 2018):

qBT 32bit is limited to 2 GB virtual memory, which it usually hits before reaching 1.8 GB used ram...which for me happens with the cache set as low as 1 GB...and sometimes even with cache set far lower. (~200 MB once!)

qBT 64bit can hit 5.5-6 GB virtual memory and 5-5.5 GB used ram with a 4 GB max cache size.

Unless you have ram-to-spare, I don't recommend setting qBT's cache over 500 MB.
However, HIGH download/upload speeds (over 5 MB/sec) may require a larger cache if running on slower HDDs.

Regardless of cache size, I recommend making the cache expiry interval 600 seconds (max allowed) to reduce wasteful churn.

@Seeker2 commented on GitHub (May 20, 2018): qBT 32bit is limited to 2 GB virtual memory, which it usually hits before reaching 1.8 GB used ram...which for me happens with the cache set as low as 1 GB...and sometimes even with cache set far lower. (~200 MB once!) qBT 64bit can hit 5.5-6 GB virtual memory and 5-5.5 GB used ram with a 4 GB max cache size. Unless you have ram-to-spare, I don't recommend setting qBT's cache over 500 MB. However, HIGH download/upload speeds (over 5 MB/sec) may require a larger cache if running on slower HDDs. Regardless of cache size, I recommend making the cache expiry interval 600 seconds (max allowed) to reduce wasteful churn.
Author
Owner

@MPW1412 commented on GitHub (May 20, 2018):

As far as I understand, the qBT's caching functionality should never lead to the point that the kernel kills qBT in an out of memory situation, which happend to me several times over the past few weeks.

Or doesn't qBT check with available memory?

@MPW1412 commented on GitHub (May 20, 2018): As far as I understand, the qBT's caching functionality should never lead to the point that the kernel kills qBT in an out of memory situation, which happend to me several times over the past few weeks. Or doesn't qBT check with available memory?
Author
Owner

@Seeker2 commented on GitHub (May 21, 2018):

qBT may not be able to check virtual memory exhaustion even if it does check available memory.

@Seeker2 commented on GitHub (May 21, 2018): qBT may not be able to check virtual memory exhaustion even if it does check available memory.
Author
Owner

@FranciscoPombal commented on GitHub (May 21, 2018):

Does the memory cache count toward the 2 GiB limit on 32-bit systems? @sledgehammer999 @Chocobo1

@FranciscoPombal commented on GitHub (May 21, 2018): Does the memory cache count toward the 2 GiB limit on 32-bit systems? @sledgehammer999 @Chocobo1
Author
Owner

@MPW1412 commented on GitHub (May 21, 2018):

What is the difference between virtual memory exhaustion and available memory?

@MPW1412 commented on GitHub (May 21, 2018): What is the difference between virtual memory exhaustion and available memory?
Author
Owner

@K7and commented on GitHub (May 21, 2018):

Hi, the original reported issue is about Windows X64, so 4GB limit is not relevant here.
Nothing changed with latest version.

qBT memory management is seriously broken!

@K7and commented on GitHub (May 21, 2018): Hi, the original reported issue is about Windows X64, so 4GB limit is not relevant here. Nothing changed with latest version. qBT memory management is seriously broken!
Author
Owner

@Seeker2 commented on GitHub (May 21, 2018):

The memory cache absolutely counts towards the 2 GB program (qbittorrent.exe) max use limit on 32-bit systems. qBitTorrent doesn't use IMAGE_FILE_LARGE_ADDRESS_AWARE (Deluge does despite using libtorrent as well), so it cannot reach 3 GB memory (real OR virtual) used.

Even when 32-bit qBitTorrent's virtual memory use reaches 2 GB, it is guaranteed to crash.
64-bit qBitTorrent suffers an even worse virtual memory leak, which can be 2 GB larger than qbittorrent.exe's max cache size. It will also crash, but only if almost all virtual memory or real memory is used.

Other reported issues of a similar nature: https://github.com/qbittorrent/qBittorrent/issues/8563#issuecomment-372128640

@Seeker2 commented on GitHub (May 21, 2018): The memory cache absolutely counts towards the 2 GB program (qbittorrent.exe) max use limit on 32-bit systems. qBitTorrent doesn't use IMAGE_FILE_LARGE_ADDRESS_AWARE (Deluge does despite using libtorrent as well), so it cannot reach 3 GB memory (real OR virtual) used. Even when 32-bit qBitTorrent's virtual memory use reaches 2 GB, it is guaranteed to crash. 64-bit qBitTorrent suffers an even worse virtual memory leak, which can be 2 GB larger than qbittorrent.exe's max cache size. It will also crash, but only if almost all virtual memory or real memory is used. Other reported issues of a similar nature: https://github.com/qbittorrent/qBittorrent/issues/8563#issuecomment-372128640
Author
Owner

@ngosang commented on GitHub (Sep 16, 2018):

We are closing all issues related to old qBittorrent versions (qBittorrent < 4.1.0).
Please, update to last release and, if the bug/error/crash is still present, open another issue.
Thank you.

@ngosang commented on GitHub (Sep 16, 2018): We are closing all issues related to old qBittorrent versions (qBittorrent < 4.1.0). Please, update to last release and, if the bug/error/crash is still present, open another issue. Thank you.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#6716
No description provided.