mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-23 22:55:23 -07:00
parent
e5894831ec
commit
c062f86bac
1 changed files with 1 additions and 1 deletions
|
@ -798,7 +798,7 @@ void Application::shutdownCleanup(QSessionManager &manager)
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
void Application::applyMemoryWorkingSetLimit()
|
void Application::applyMemoryWorkingSetLimit()
|
||||||
{
|
{
|
||||||
const int UNIT_SIZE = 1024 * 1024; // MiB
|
const SIZE_T UNIT_SIZE = 1024 * 1024; // MiB
|
||||||
const SIZE_T maxSize = memoryWorkingSetLimit() * UNIT_SIZE;
|
const SIZE_T maxSize = memoryWorkingSetLimit() * UNIT_SIZE;
|
||||||
const SIZE_T minSize = std::min<SIZE_T>((64 * UNIT_SIZE), (maxSize / 2));
|
const SIZE_T minSize = std::min<SIZE_T>((64 * UNIT_SIZE), (maxSize / 2));
|
||||||
if (!::SetProcessWorkingSetSizeEx(::GetCurrentProcess(), minSize, maxSize, QUOTA_LIMITS_HARDWS_MAX_ENABLE))
|
if (!::SetProcessWorkingSetSizeEx(::GetCurrentProcess(), minSize, maxSize, QUOTA_LIMITS_HARDWS_MAX_ENABLE))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue