From c599976b6f37340fc15e242dc187072f1748f94d Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Wed, 19 Jun 2019 22:01:25 +0800 Subject: [PATCH 1/2] Remove upper limit of "Disk cache" setting --- src/base/bittorrent/session.cpp | 8 +++----- src/gui/advancedsettings.cpp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index ab39677c0..71694358d 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -3113,22 +3113,20 @@ void Session::setCheckingMemUsage(int size) int Session::diskCacheSize() const { - int size = m_diskCacheSize; // These macros may not be available on compilers other than MSVC and GCC #if defined(__x86_64__) || defined(_M_X64) - size = qMin(size, 4096); // 4GiB + return qMin(m_diskCacheSize.value(), 33554431); // 32768GiB #else // When build as 32bit binary, set the maximum at less than 2GB to prevent crashes // allocate 1536MiB and leave 512MiB to the rest of program data in RAM - size = qMin(size, 1536); + return qMin(m_diskCacheSize.value(), 1536); #endif - return size; } void Session::setDiskCacheSize(int size) { #if defined(__x86_64__) || defined(_M_X64) - size = qMin(size, 4096); // 4GiB + size = qMin(size, 33554431); // 32768GiB #else // allocate 1536MiB and leave 512MiB to the rest of program data in RAM size = qMin(size, 1536); diff --git a/src/gui/advancedsettings.cpp b/src/gui/advancedsettings.cpp index 27ed7dfd5..f7f2cc7f5 100644 --- a/src/gui/advancedsettings.cpp +++ b/src/gui/advancedsettings.cpp @@ -341,7 +341,7 @@ void AdvancedSettings::loadAdvancedSettings() // When build as 32bit binary, set the maximum at less than 2GB to prevent crashes. // These macros may not be available on compilers other than MSVC and GCC #if defined(__x86_64__) || defined(_M_X64) - spinBoxCache.setMaximum(4096); + spinBoxCache.setMaximum(33554431); // 32768GiB #else // allocate 1536MiB and leave 512MiB to the rest of program data in RAM spinBoxCache.setMaximum(1536); From ae21d0f1e2c0de2c515ee9fa6810338827ddea14 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Wed, 19 Jun 2019 22:15:58 +0800 Subject: [PATCH 2/2] Remove limits of "Disk cache expiry interval" setting --- src/gui/advancedsettings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/advancedsettings.cpp b/src/gui/advancedsettings.cpp index f7f2cc7f5..d1329e02c 100644 --- a/src/gui/advancedsettings.cpp +++ b/src/gui/advancedsettings.cpp @@ -350,8 +350,8 @@ void AdvancedSettings::loadAdvancedSettings() updateCacheSpinSuffix(spinBoxCache.value()); addRow(DISK_CACHE, tr("Disk cache"), &spinBoxCache); // Disk cache expiry - spinBoxCacheTTL.setMinimum(15); - spinBoxCacheTTL.setMaximum(600); + spinBoxCacheTTL.setMinimum(1); + spinBoxCacheTTL.setMaximum(std::numeric_limits::max()); spinBoxCacheTTL.setValue(session->diskCacheTTL()); spinBoxCacheTTL.setSuffix(tr(" s", " seconds")); addRow(DISK_CACHE_TTL, tr("Disk cache expiry interval"), &spinBoxCacheTTL);