Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Unified Diff: chrome/browser/history/history_database.cc

Issue 8379009: Add a field trial for using lower sqlite cache sizes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/history_database.cc
===================================================================
--- chrome/browser/history/history_database.cc (revision 106923)
+++ chrome/browser/history/history_database.cc (working copy)
@@ -14,6 +14,7 @@
#include "base/rand_util.h"
#include "base/string_util.h"
#include "chrome/browser/diagnostics/sqlite_diagnostics.h"
+#include "chrome/browser/history/history_field_trial.h"
#include "sql/transaction.h"
#if defined(OS_MACOSX)
@@ -78,11 +79,15 @@
// this is a NOP. Must be a power of 2 and a max of 8192.
db_.set_page_size(4096);
- // Increase the cache size. The page size, plus a little extra, times this
- // value, tells us how much memory the cache will use maximum.
- // 6000 * 4MB = 24MB
- // TODO(brettw) scale this value to the amount of available memory.
- db_.set_cache_size(6000);
+ if (HistoryFieldTrial::IsLowMemFieldTrial()) {
+ db_.set_cache_size(500);
+ } else {
+ // Increase the cache size. The page size, plus a little extra, times this
+ // value, tells us how much memory the cache will use maximum.
+ // 6000 * 4MB = 24MB
+ // TODO(brettw) scale this value to the amount of available memory.
+ db_.set_cache_size(6000);
+ }
// Note that we don't set exclusive locking here. That's done by
// BeginExclusiveMode below which is called later (we have to be in shared

Powered by Google App Engine
This is Rietveld 408576698