mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
qBittorrent slow shutdown with many torrents #7544
Labels
No labels
Accessibility
AppImage
Bounty
Build system
CI
Can't reproduce
Code cleanup
Confirmed bug
Confirmed bug
Core
Crash
Data loss
Discussion
Docker
Documentation
Duplicate
Feature
Feature request
Feature request
Feature request
Filters
Flatpak
GUI
Has workaround
I2P
Invalid
Libtorrent
Look and feel
Meta
NSIS
Network
Not an issue
OS: *BSD
OS: Linux
OS: Windows
OS: macOS
PPA
Performance
Project management
Proxy/VPN
Qt bugs
Qt6 compat
RSS
Search engine
Security
Temp folder
Themes
Translations
Triggers
Waiting diagnosis
Waiting info
Waiting upstream
Waiting web implementation
Watched folders
WebAPI
WebUI
autoCloseOldIssue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/qBittorrent#7544
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sandersaares on GitHub (Jul 27, 2018).
qBittorrent version and Operating System
4.1.1 x64 on Windows 10
What is the problem
After File->Exit, qbittorrent.exe remains in the background for 5-10 minutes. This causes inconvenient delays during system shutdown.
What is the expected behavior
Fast shutdown (on the range of 10 seconds).
Steps to reproduce
Extra info(if any)
During this "shutting down" phase, the only resource usage visible is 1 CPU core that is fully utilized by the following thread:
There is no significant disk activity. RAM usage gradually declines to zero. The screenshot below is typical of this shutdown period.
I am unfamiliar with the internals of how the code works but spending minutes reallocating memory during shutdown implies to me that there is room for algorithmic optimization here.
@slrslr commented on GitHub (Jul 28, 2018):
Yes, same happen to me on Windows 10, i think this is common issue, already described here: #5097
But i got used to this issue. Once, i have seen that when i disconnected internet, the process immediately disappeared, not sure if it was coincidence but think someone was saying it has to do with active internet connections.
@bathrobehero commented on GitHub (Aug 1, 2018):
Same for me, Windows 8.1 x64 but it doesn't terminates the process even after hours or days. Only "I/O other bytes" increases slowly in task manager.
@Cpucino commented on GitHub (Aug 4, 2018):
Same problem here under Windows 7 x64. Locks all open applications, usually have to disconnect power to shut down.
@sandersaares commented on GitHub (Aug 21, 2018):
Issue also reproduces if I just pause all the torrents instead of File->Exit.
@sandersaares commented on GitHub (Nov 18, 2018):
During the "hang", libtorrent is doing this:
Approx 5 lines per second appear in the libtorrent cache log. It seems to have some inefficiency in cache flushing on Windows. Will try to dig deeper.
Edit 2: The disk cache is allociated via a lots of
_aligned_mallocbuffers. It is the freeing of these bazillion tiny pieces that is being slow on Windows.Edit 3:
use_disk_cache_pool=truefixes it.@sandersaares commented on GitHub (Nov 23, 2018):
Fixed in libtorrent: https://github.com/arvidn/libtorrent/pull/3488
I request this fix be included in qBittorrent.
@thalieht commented on GitHub (Nov 23, 2018):
Should be in qBt when it uses a libtorrent version with that fix.
@xavier2k6 commented on GitHub (Sep 30, 2019):
@sandersaares Try 4.1.8 & report back.
@sandersaares commented on GitHub (Oct 20, 2019):
4.1.8 no longer reproduces the issue. In fact, I saw it go away around 4.1.5 or so already (not sure when exactly, was using custom build with the fix for some time span). Just forgot to close this earlier!