mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Remove "Physical memory (RAM) usage limit" option on Linux
Memory working set limit is not effective on Linux at all. See [`getrlimit(2)`](https://man7.org/linux/man-pages/man2/getrlimit.2.html) → `RLIMIT_RSS`. Introduced in #16874, disabled for macOS in #19805. This PR hides the option for Linux too. Worth to mention that #19805 did not deliver the change for WebUI. So there is also a small fixup, I covered both cases. Also removed pointless "This option is less effective on Linux" remark. PR #22680.
This commit is contained in:
parent
de767871f1
commit
b79ac0d716
4 changed files with 11 additions and 9 deletions
|
@ -410,7 +410,7 @@ void Application::setMemoryWorkingSetLimit(const int size)
|
|||
return;
|
||||
|
||||
m_storeMemoryWorkingSetLimit = size;
|
||||
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
|
||||
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_LINUX) && !defined(Q_OS_MACOS)
|
||||
applyMemoryWorkingSetLimit();
|
||||
#endif
|
||||
}
|
||||
|
@ -844,7 +844,7 @@ int Application::exec()
|
|||
printf("%s\n", qUtf8Printable(loadingStr));
|
||||
#endif
|
||||
|
||||
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
|
||||
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_LINUX) && !defined(Q_OS_MACOS)
|
||||
applyMemoryWorkingSetLimit();
|
||||
#endif
|
||||
|
||||
|
@ -1202,7 +1202,7 @@ void Application::shutdownCleanup([[maybe_unused]] QSessionManager &manager)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
|
||||
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_LINUX) && !defined(Q_OS_MACOS)
|
||||
void Application::applyMemoryWorkingSetLimit() const
|
||||
{
|
||||
const size_t MiB = 1024 * 1024;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue