From d6e067d654cf19ddb4d017379cfff660902ffd91 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 3 Dec 2012 20:12:08 +0200 Subject: [PATCH] Revert "Reenable OS cache on Windows" This reverts commit 8a27c797166e9e8c60779ae516ee8406b79e3aaf. --- src/qtlibtorrent/qbtsession.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index da8334287..24e7d8c5c 100755 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -405,6 +405,12 @@ void QBtSession::configureSession() { int cache_size = pref.diskCacheSize(); sessionSettings.cache_size = cache_size ? cache_size * 64 : -1; qDebug() << "Using a disk cache size of" << pref.diskCacheSize() << "MiB"; + // Disable OS cache to avoid memory problems (uTorrent behavior) +#ifdef Q_WS_WIN + // Fixes huge memory usage on Windows 7 (especially when checking files) + sessionSettings.disk_io_write_mode = session_settings::disable_os_cache; + sessionSettings.disk_io_read_mode = session_settings::disable_os_cache; +#endif #if LIBTORRENT_VERSION_MINOR > 15 sessionSettings.anonymous_mode = pref.isAnonymousModeEnabled(); if (sessionSettings.anonymous_mode) {