mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 10:46:04 +03:00
Remove "Physical memory (RAM) usage limit" option on macOS #19805
This has no effect on macOS. https://stackoverflow.com/questions/3274385/how-to-limit-memory-of-a-os-x-program-ulimit-v-neither-m-are-working Closes #18656. PR #19805.
This commit is contained in:
parent
a396e0df26
commit
bb6d69f8b7
4 changed files with 13 additions and 8 deletions
|
@ -375,7 +375,7 @@ void Application::setMemoryWorkingSetLimit(const int size)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_storeMemoryWorkingSetLimit = size;
|
m_storeMemoryWorkingSetLimit = size;
|
||||||
#ifdef QBT_USES_LIBTORRENT2
|
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
|
||||||
applyMemoryWorkingSetLimit();
|
applyMemoryWorkingSetLimit();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -773,7 +773,7 @@ int Application::exec()
|
||||||
printf("%s\n", qUtf8Printable(loadingStr));
|
printf("%s\n", qUtf8Printable(loadingStr));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef QBT_USES_LIBTORRENT2
|
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
|
||||||
applyMemoryWorkingSetLimit();
|
applyMemoryWorkingSetLimit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1080,7 +1080,7 @@ void Application::shutdownCleanup(QSessionManager &manager)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef QBT_USES_LIBTORRENT2
|
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
|
||||||
void Application::applyMemoryWorkingSetLimit() const
|
void Application::applyMemoryWorkingSetLimit() const
|
||||||
{
|
{
|
||||||
const size_t MiB = 1024 * 1024;
|
const size_t MiB = 1024 * 1024;
|
||||||
|
|
|
@ -154,7 +154,7 @@ private:
|
||||||
void runExternalProgram(const QString &programTemplate, const BitTorrent::Torrent *torrent) const;
|
void runExternalProgram(const QString &programTemplate, const BitTorrent::Torrent *torrent) const;
|
||||||
void sendNotificationEmail(const BitTorrent::Torrent *torrent);
|
void sendNotificationEmail(const BitTorrent::Torrent *torrent);
|
||||||
|
|
||||||
#ifdef QBT_USES_LIBTORRENT2
|
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
|
||||||
void applyMemoryWorkingSetLimit() const;
|
void applyMemoryWorkingSetLimit() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ namespace
|
||||||
// qBittorrent section
|
// qBittorrent section
|
||||||
QBITTORRENT_HEADER,
|
QBITTORRENT_HEADER,
|
||||||
RESUME_DATA_STORAGE,
|
RESUME_DATA_STORAGE,
|
||||||
#ifdef QBT_USES_LIBTORRENT2
|
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
|
||||||
MEMORY_WORKING_SET_LIMIT,
|
MEMORY_WORKING_SET_LIMIT,
|
||||||
#endif
|
#endif
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
|
@ -195,7 +195,7 @@ void AdvancedSettings::saveAdvancedSettings() const
|
||||||
BitTorrent::Session *const session = BitTorrent::Session::instance();
|
BitTorrent::Session *const session = BitTorrent::Session::instance();
|
||||||
|
|
||||||
session->setResumeDataStorageType(m_comboBoxResumeDataStorage.currentData().value<BitTorrent::ResumeDataStorageType>());
|
session->setResumeDataStorageType(m_comboBoxResumeDataStorage.currentData().value<BitTorrent::ResumeDataStorageType>());
|
||||||
#ifdef QBT_USES_LIBTORRENT2
|
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
|
||||||
// Physical memory (RAM) usage limit
|
// Physical memory (RAM) usage limit
|
||||||
app()->setMemoryWorkingSetLimit(m_spinBoxMemoryWorkingSetLimit.value());
|
app()->setMemoryWorkingSetLimit(m_spinBoxMemoryWorkingSetLimit.value());
|
||||||
#endif
|
#endif
|
||||||
|
@ -451,7 +451,7 @@ void AdvancedSettings::loadAdvancedSettings()
|
||||||
m_comboBoxResumeDataStorage.setCurrentIndex(m_comboBoxResumeDataStorage.findData(QVariant::fromValue(session->resumeDataStorageType())));
|
m_comboBoxResumeDataStorage.setCurrentIndex(m_comboBoxResumeDataStorage.findData(QVariant::fromValue(session->resumeDataStorageType())));
|
||||||
addRow(RESUME_DATA_STORAGE, tr("Resume data storage type (requires restart)"), &m_comboBoxResumeDataStorage);
|
addRow(RESUME_DATA_STORAGE, tr("Resume data storage type (requires restart)"), &m_comboBoxResumeDataStorage);
|
||||||
|
|
||||||
#ifdef QBT_USES_LIBTORRENT2
|
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
|
||||||
// Physical memory (RAM) usage limit
|
// Physical memory (RAM) usage limit
|
||||||
m_spinBoxMemoryWorkingSetLimit.setMinimum(1);
|
m_spinBoxMemoryWorkingSetLimit.setMinimum(1);
|
||||||
m_spinBoxMemoryWorkingSetLimit.setMaximum(std::numeric_limits<int>::max());
|
m_spinBoxMemoryWorkingSetLimit.setMaximum(std::numeric_limits<int>::max());
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
#include <libtorrent/config.hpp>
|
#include <libtorrent/config.hpp>
|
||||||
|
|
||||||
|
#include <QtGlobal>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
@ -88,7 +89,11 @@ private:
|
||||||
QCheckBox m_checkBoxCoalesceRW;
|
QCheckBox m_checkBoxCoalesceRW;
|
||||||
#else
|
#else
|
||||||
QComboBox m_comboBoxDiskIOType;
|
QComboBox m_comboBoxDiskIOType;
|
||||||
QSpinBox m_spinBoxMemoryWorkingSetLimit, m_spinBoxHashingThreads;
|
QSpinBox m_spinBoxHashingThreads;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
|
||||||
|
QSpinBox m_spinBoxMemoryWorkingSetLimit;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(QBT_USES_LIBTORRENT2) && TORRENT_USE_I2P
|
#if defined(QBT_USES_LIBTORRENT2) && TORRENT_USE_I2P
|
||||||
|
|
Loading…
Reference in a new issue