mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
Make working set limit available only on libtorrent 2.0.x builds
You can already control the cache size in libtorrent 1.2.x so it doesn't make sense to implement this limit for all use cases. Also there are some downsides to using working set size to limit memory usage such as unresponsive GUI when limit gets hit. PR #17275.
This commit is contained in:
parent
0e989185ce
commit
cc0a0b56ed
5 changed files with 17 additions and 3 deletions
|
@ -216,7 +216,9 @@ void Application::setMemoryWorkingSetLimit(const int size)
|
|||
return;
|
||||
|
||||
m_storeMemoryWorkingSetLimit = size;
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
applyMemoryWorkingSetLimit();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Application::isFileLoggerEnabled() const
|
||||
|
@ -595,7 +597,9 @@ void Application::processParams(const QStringList ¶ms)
|
|||
|
||||
int Application::exec(const QStringList ¶ms)
|
||||
{
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
applyMemoryWorkingSetLimit();
|
||||
#endif
|
||||
|
||||
Net::ProxyConfigurationManager::initInstance();
|
||||
Net::DownloadManager::initInstance();
|
||||
|
@ -766,6 +770,7 @@ void Application::shutdownCleanup(QSessionManager &manager)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
void Application::applyMemoryWorkingSetLimit()
|
||||
{
|
||||
const size_t MiB = 1024 * 1024;
|
||||
|
@ -803,6 +808,7 @@ void Application::applyMemoryWorkingSetLimit()
|
|||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void Application::cleanup()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue