Chromium Code Reviews| 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. |