qBittorrent icon indicating copy to clipboard operation
qBittorrent copied to clipboard

v4.4.5 x64 - Insane memory usage (Windows)

Open FiTADiNE opened this issue 2 years ago • 60 comments

qBittorrent & operating system versions

qBittorrent: v4.4.5 x64 OS: Windows 10 x64 21H2 10.0.19044 Qt: 6.3.0 Libtorrent: 1.2.17.0 32 GB RAM

What is the problem?

Insane memory leak. 5k torrents. In previous versions there was excessive consumption and chrome/telegram/media(vids, streams) crashes, even with a memory usage limit. 2 3

Steps to reproduce

  1. Start qB
  2. Wait
  3. ???
  4. Profit.

Additional context

No memory leak with all seeding torrents turned off.

Log(s) & preferences file(s)

No response

FiTADiNE avatar Sep 06 '22 06:09 FiTADiNE

In previous versions there was excessive consumption and chrome/telegram/media(vids, streams) crashes, even with a memory usage limit.

Why do you report about previous versions?

glassez avatar Sep 06 '22 13:09 glassez

Why do you report about previous versions?

Just for additional information. Main report about last version.

FiTADiNE avatar Sep 06 '22 13:09 FiTADiNE

Seems like a duplicate of many other issues reported this year. It is connected with libtorrent v2 - https://github.com/arvidn/libtorrent/issues/6667

Speaking of the current topic, it is better to switch to the client version with libtorrent v1. And since 4.4.5 it is default build. You can get under qBittorrent Windows x64 link from https://www.fosshub.com/qBittorrent.html

After installing it you'll see something like this in About dialog: image

adem4ik avatar Sep 06 '22 15:09 adem4ik

@adem4ik, sorry, there was a mistake in libtorrent ver. My current version is 1.2.17.0 already. Scr460

FiTADiNE avatar Sep 06 '22 15:09 FiTADiNE

@FiTADiNE in this case you can limit RAM usage by setting up Tools>Options>Advanced>Disk cache (Кэш диска). -1 means unlimited/auto. Only build with libtorrent v1 has such option. image

adem4ik avatar Sep 06 '22 16:09 adem4ik

@adem4ik, probably, in prev releases there was RAM limit, but now it's disk cache limit. Omg... Thanks, i'll try it.

FiTADiNE avatar Sep 06 '22 19:09 FiTADiNE

This is a separate thing, but how did you get your task manager to be dark like that?

ElectricityMachine avatar Sep 07 '22 00:09 ElectricityMachine

@adem4ik, still the same. @ElectricityMachine, just windows dark theme. Scr461

FiTADiNE avatar Sep 07 '22 06:09 FiTADiNE

4.4.5(libtorrent1+qt5) x64 uses 300-400 MB more memory than the disk cache size. 4.3.9 did not.

pulbitz avatar Sep 07 '22 11:09 pulbitz

@pulbitz, best way is downgrading to 4.3.9?

FiTADiNE avatar Sep 07 '22 12:09 FiTADiNE

@pulbitz, best way is downgrading to 4.3.9?

I think it's a bit odd to use around 300-400 MB more memory than the disk cache size I specified. That's all. I'm still using 4.4.5 (libtorrent1+qt5) as there are no other inconveniences.

pulbitz avatar Sep 07 '22 12:09 pulbitz

4.4.5(libtorrent1+qt5) x64 uses 300-400 MB more memory than the disk cache size.

Do you think qBittorrent uses memory only for the disk cache?

glassez avatar Sep 07 '22 12:09 glassez

I usually use the disk cache size set to 4096 MB. Below is the result of measuring memory usage in Process Explorer. And I tested it by setting it to 1024 MB.

1 4096MB 2 4096MB-proc

3 1024MB 4 1024MB-proc

pulbitz avatar Sep 07 '22 13:09 pulbitz

qB 4 4 3 1

Working Set limit 1024MB.

PE 4 4 3 1

25% of 32GB RAM used after 15 minutes. (Work around application stuttering on Windows not fixed [fixed in 4.4.4]).

qB 4 4 5

Disk Cache limit 1024MB.

PE 4 4 5

68% of 32GB RAM used after 15 minutes and growing. (Peak Working set cuz i've tried 2048MB Disk Cache).

FiTADiNE avatar Sep 07 '22 14:09 FiTADiNE

FiTADiNE, decide already which version of qbt you are using and on which libtorrent.

stalkerok avatar Sep 07 '22 15:09 stalkerok

@stalkerok, already decided in 1st post.

FiTADiNE avatar Sep 07 '22 15:09 FiTADiNE

Working Set limit 1024MB.

PE 4 4 3 1

25% of 32GB RAM used after 15 minutes.

There are less than 1GB of RAM used on this screenshot. The similar contradiction is in your second screenshot and related comment.

glassez avatar Sep 07 '22 15:09 glassez

@glassez, yes, cuz it's older version on libtorrent 2 with Working set limit parameter and w/o memory leak. Here you can see 2 screenshots: 1066MB qB usage with total 88% of RAM (28.16GB) and 21% total of RAM (6.72GB) w/o qB.

Today i've tested older version, and last on Qt5. 4.4.5 has memory leak with libtorrent 1.2.17.0 on any Qt. 4.4.3.1 on libtorrent 2.0.6.0 doesn't have memory leak, but has problem with "work around application stuttering on Windows" which was fixed in 4.4.4.

Now i'm testing 4.4.5 RC_2 with libtorrent 2.0.7.0

FiTADiNE avatar Sep 07 '22 15:09 FiTADiNE

@FiTADiNE, have you tried lowering the memory priority?

stalkerok avatar Sep 07 '22 15:09 stalkerok

1066MB qB usage with total 88% of RAM (28.16GB)

Unfortunately, your screenshot does not provide any information about what actually uses all this memory.

4.4.5 has memory leak with libtorrent 1.2.17.0 on any Qt

There can be no memory usage that is not taken into account by the operating system (unless of course there is a memory leak in the operating system itself). Even if there is a memory leak in some application program, the operating system knows that this memory is occupied by this program.

Of course, this memory can be used by the operating system itself for something related to the operation of qBittorrent (for example, for I/O caching). Therefore, it would be much more useful if you presented a more accurate source of memory consumption. Besides, it would be better to see reports in a more structured form (since you decided to compare data on the work of several qBittorrent versions).

glassez avatar Sep 07 '22 17:09 glassez

@stalkerok, no, should i? And why?

@glassez, lolwhat? 1st screen: qB works, 88% of 32GB RAM. Second: qB closed, 21% of 32GB RAM. What kind of screenshot do you need? Maybe i should record video? UPD: i'll be glad if you tell me, how can i present more accurate source of memory consumption and structured form of reports.

FiTADiNE avatar Sep 07 '22 17:09 FiTADiNE

@FiTADiNE, disable the OS cache and set the memory usage to the lowest level, this will reduce the memory consumption.

stalkerok avatar Sep 07 '22 17:09 stalkerok

1st screen: qB works, 88% of 32GB RAM. Second: qB closed, 21% of 32GB RAM. What kind of screenshot do you need?

Where it is seen what exactly uses all these memory.

glassez avatar Sep 07 '22 17:09 glassez

structured form of reports

Since you provide reports about different qBittorrent version don't forget to attach info about used qBittorrent, libtorrent, OS, etc.

glassez avatar Sep 07 '22 18:09 glassez

Where it is seen what exactly uses all these memory.

Okay, where could i see it?

Since you provide reports about different qBittorrent version don't forget to attach info about used qBittorrent, libtorrent, OS, etc.

Already done (with attached screenshots and text information in posts).

v4.4.5 RC_2, Qt 6.3.0, libtorrent 2.0.7.0. 30% of RAM used. Works fine probably, but Private bytes...?

Scr471

Scr470

Scr472

FiTADiNE avatar Sep 07 '22 18:09 FiTADiNE

I do not understand what people expect the RAM usage to be with 5000 torrents. If qBt has to constantly access and read files from disk, the OS is definitely caching some of them and even with a working set limit you may not have control over how the OS behaves. If there is a memory leak, you should run a profiler and collect data for the developers to look into it and see if there's indeed a leak or it's just the OS.

ghost avatar Sep 08 '22 17:09 ghost

I do not understand what people expect the RAM usage to be with 5000 torrents.

What do you expect it to be?

Pentaphon avatar Sep 10 '22 08:09 Pentaphon

@summerqB, well, now i'm testing v4.4.5 Qt6 libtorrent 2.0.7.0 and i don't have any problems with RAM. 350MB usage with 1024MB Working set limit, and 21% usage of total RAM with no "Work around application stuttering on Windows".

FiTADiNE avatar Sep 10 '22 09:09 FiTADiNE

I do not understand what people expect the RAM usage to be with 5000 torrents.

What do you expect it to be?

Anywhere between 16 to 32 GB. Also someone should not be seeding 5k torrents on a regular PC and expect the torrent client to not bog down the system. It should be done on a dedicated system with adequate CPU, RAM, Network capacity and proper storage medium to be able to handle the I/O demand.

ghost avatar Sep 10 '22 09:09 ghost

Also you should note that less RAM limit will result in more page faults, the OS will flush the dirty pages earlier, as well as the clean pages, resulting in frequent read/write which could’ve been avoided if the program had cached more data in physical memory.

ghost avatar Sep 10 '22 09:09 ghost