diff options
author | bratell <bratell@opera.com> | 2016-02-05 03:04:53 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-05 11:05:41 +0000 |
commit | e4286a6f1d07ede602eebbbe0e604306c1713534 (patch) | |
tree | a7c8beb481b180954e78d01ef6489b33b369a9eb | |
parent | 88860877a8fc879bdfd7feeeeedf4cad05ca43e3 (diff) | |
download | chromium_src-e4286a6f1d07ede602eebbbe0e604306c1713534.zip chromium_src-e4286a6f1d07ede602eebbbe0e604306c1713534.tar.gz chromium_src-e4286a6f1d07ede602eebbbe0e604306c1713534.tar.bz2 |
Set DOM Storage buffer size so that not everything ends up in RAM
When a database is opened the log file is read and if the write
buffer is large then it stays in memory, and this happens
every time the browser starts. By reducing the write buffer
the log file will be written into the database the first time
and then very little RAM will be used for that data.
BUG=583629
Review URL: https://codereview.chromium.org/1668463003
Cr-Commit-Position: refs/heads/master@{#373780}
-rw-r--r-- | content/browser/dom_storage/session_storage_database.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/content/browser/dom_storage/session_storage_database.cc b/content/browser/dom_storage/session_storage_database.cc index ec24616..0aea7c7 100644 --- a/content/browser/dom_storage/session_storage_database.cc +++ b/content/browser/dom_storage/session_storage_database.cc @@ -383,6 +383,9 @@ leveldb::Status SessionStorageDatabase::TryToOpen(leveldb::DB** db) { options.max_open_files = 0; // Use minimum. options.create_if_missing = true; options.reuse_logs = leveldb_env::kDefaultLogReuseOptionValue; + // Default write_buffer_size is 4 MB but that might leave a 3.999 + // memory allocation in RAM from a log file recovery. + options.write_buffer_size = 64 * 1024; return leveldb::DB::Open(options, file_path_.AsUTF8Unsafe(), db); } |