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

Unified Diff: base/memory/memory_coordinator.md

Issue 2678323002: Add documentation for MemoryCoordinator-related primitives
Patch Set: temp Created 3 years, 10 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
« no previous file with comments | « no previous file | base/memory/memory_coordinator_client.h » ('j') | base/memory/memory_coordinator_client.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/memory_coordinator.md
diff --git a/base/memory/memory_coordinator.md b/base/memory/memory_coordinator.md
new file mode 100644
index 0000000000000000000000000000000000000000..bb9d2af639d83c6f89eb3b6c72ae3744a493b35c
--- /dev/null
+++ b/base/memory/memory_coordinator.md
@@ -0,0 +1,33 @@
+# Overview
+
+To be a good memory citizen, each memory-intensive component needs to
+have the following two notions:
Ryan Sleevi 2017/02/25 02:57:10 Suggestion: "memory-intensive" leaves it subjectiv
+
+(a) How to deal with past allocations when the system is under high memroy pressure.
+Specifically, the component is expected to purge as much memory as possible.
+This is a 'reactive' way to reduce memory footprint.
+
+(b) How to deal with future allocations when the system is under high memroy pressure.
+Specifically, the component is expected to throttle future memory allocations by,
+for example, lowering the cache size. This is a 'proactive' way to reduce memory footprint.
+
+# Current status
Ryan Sleevi 2017/02/25 02:57:10 # Current Status ## Reactive Reduction To properl
+
+Currently we have three ways to control memory components:
+MemoryCoordinator, MemoryPressureListener and isLowEndDevice.
+
+* The MemoryPressureListener provides a way for memory components to listen
+memory-pressure notifications and purge memory when the system is under
+high memory pressure. The MemoryPressureListener is an interface that provides APIs
+to deal with (a).
+
+* The isLowEndDevice provides a way for memory components to enter a low-memory
+mode on low-memory devices. In the low-memory mode, the memory components
+are exepcted to trade off performance for memory. The isLowEndDevice is a compile-time
+configuration to deal with (b).
+
+* MemoryCoordinator is going to provide APIs for (a) and (b). In the future,
+the MemoryPressureListener and the isLowEndDevice will be unified into the MemoryCoordinator.
+The MemoryCoordinator is still behind a runtime flag. Until it is fully shipped,
+each memory component needs to support all of the MemoryPressureListener,
+the isLowEndDevice and the MemoryCoordinator.
« no previous file with comments | « no previous file | base/memory/memory_coordinator_client.h » ('j') | base/memory/memory_coordinator_client.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698