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:
Hanabishi 2025-05-12 21:49:18 +05:00 committed by GitHub
parent de767871f1
commit b79ac0d716
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 9 deletions

View file

@ -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;