mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 05:38:06 -06:00
committed by
GitHub
parent
ba147d72b9
commit
11c45db2ec
@@ -64,6 +64,7 @@ namespace
|
||||
RESUME_DATA_STORAGE,
|
||||
#if defined(Q_OS_WIN)
|
||||
OS_MEMORY_PRIORITY,
|
||||
MEMORY_WORKING_SET_LIMIT,
|
||||
#endif
|
||||
// network interface
|
||||
NETWORK_IFACE,
|
||||
@@ -196,6 +197,8 @@ void AdvancedSettings::saveAdvancedSettings()
|
||||
break;
|
||||
}
|
||||
session->setOSMemoryPriority(prio);
|
||||
|
||||
static_cast<Application *>(QCoreApplication::instance())->setMemoryWorkingSetLimit(m_spinBoxMemoryWorkingSetLimit.value());
|
||||
#endif
|
||||
// Async IO threads
|
||||
session->setAsyncIOThreads(m_spinBoxAsyncIOThreads.value());
|
||||
@@ -436,6 +439,15 @@ void AdvancedSettings::loadAdvancedSettings()
|
||||
addRow(OS_MEMORY_PRIORITY, (tr("Process memory priority (Windows >= 8 only)")
|
||||
+ ' ' + makeLink("https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-memory_priority_information", "(?)"))
|
||||
, &m_comboBoxOSMemoryPriority);
|
||||
|
||||
m_spinBoxMemoryWorkingSetLimit.setMinimum(1);
|
||||
m_spinBoxMemoryWorkingSetLimit.setMaximum(std::numeric_limits<int>::max());
|
||||
m_spinBoxMemoryWorkingSetLimit.setSuffix(tr(" MiB"));
|
||||
m_spinBoxMemoryWorkingSetLimit.setValue(static_cast<Application *>(QCoreApplication::instance())->memoryWorkingSetLimit());
|
||||
|
||||
addRow(MEMORY_WORKING_SET_LIMIT, (tr("Physical memory (RAM) usage limit")
|
||||
+ ' ' + makeLink("https://wikipedia.org/wiki/Working_set", "(?)"))
|
||||
, &m_spinBoxMemoryWorkingSetLimit);
|
||||
#endif
|
||||
|
||||
// Async IO threads
|
||||
|
||||
@@ -82,6 +82,7 @@ private:
|
||||
// OS dependent settings
|
||||
#if defined(Q_OS_WIN)
|
||||
QComboBox m_comboBoxOSMemoryPriority;
|
||||
QSpinBox m_spinBoxMemoryWorkingSetLimit;
|
||||
#endif
|
||||
|
||||
#ifndef Q_OS_MACOS
|
||||
|
||||
Reference in New Issue
Block a user