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

Side by Side Diff: base/memory/discardable_memory_emulated.cc

Issue 341773002: Revert 268371 "base: Increase emulated discardable memory limit." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/discardable_memory_emulated.h" 5 #include "base/memory/discardable_memory_emulated.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/memory/discardable_memory_manager.h" 8 #include "base/memory/discardable_memory_manager.h"
9 9
10 namespace base { 10 namespace base {
11 namespace { 11 namespace {
12 12
13 // This is admittedly pretty magical. It's approximately enough memory for eight 13 // This is admittedly pretty magical. It's approximately enough memory for four
14 // 2560x1600 images. 14 // 2560x1600 images.
15 const size_t kEmulatedMemoryLimit = 128 * 1024 * 1024; 15 const size_t kEmulatedMemoryLimit = 64 * 1024 * 1024;
16 const size_t kEmulatedBytesToKeepUnderModeratePressure = 12 * 1024 * 1024; 16 const size_t kEmulatedBytesToKeepUnderModeratePressure =
17 kEmulatedMemoryLimit / 4;
17 18
18 struct SharedState { 19 struct SharedState {
19 SharedState() 20 SharedState()
20 : manager(kEmulatedMemoryLimit, 21 : manager(kEmulatedMemoryLimit,
21 kEmulatedBytesToKeepUnderModeratePressure) {} 22 kEmulatedBytesToKeepUnderModeratePressure) {}
22 23
23 internal::DiscardableMemoryManager manager; 24 internal::DiscardableMemoryManager manager;
24 }; 25 };
25 LazyInstance<SharedState>::Leaky g_shared_state = LAZY_INSTANCE_INITIALIZER; 26 LazyInstance<SharedState>::Leaky g_shared_state = LAZY_INSTANCE_INITIALIZER;
26 27
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 memory_.reset(new uint8[bytes_]); 91 memory_.reset(new uint8[bytes_]);
91 return false; 92 return false;
92 } 93 }
93 94
94 void DiscardableMemoryEmulated::Purge() { 95 void DiscardableMemoryEmulated::Purge() {
95 memory_.reset(); 96 memory_.reset();
96 } 97 }
97 98
98 } // namespace internal 99 } // namespace internal
99 } // namespace base 100 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698