This document gives an overview of memory usage in the CC component, as well as information on how to analyze that memory.
CC uses a number of types of memory:
Memory-infra tracing will grab dumps of CC memory in several categories.
The CC category contains resource allocations made by ResourceProvider. All resource allocations are enumerated under cc/resource_memory. A subset of resources are used as tile memory, and are also enumerated under cc/tile_memory. For resources that appear in both cc/tile_memory and cc/resource_memory, the size will be attributed to cc/tile_memory (effective_size of cc/resource_memory will not include these resources).
If the one-copy tile update path is in use, the cc category will also enumerate staging resources used as intermediates when drawing tiles. These resources are like tile_memory, in that they are shared with cc/resource_memory.
Note that depending on the path being used, CC memory may be either shared memory or GPU memory:
Path | Tile Memory Type | Staging Memory Type -------------|------------------------------------------- Bitmap | Shared Memory | N/A One Copy | GPU Memory | Shared Memory Zero Copy | GPU or Shared Memory | N/A GPU | GPU Memory | N/A
Note that these values can be determined from a memory-infra dump. For a given resource, hover over the small green arrow next to it's “size”. This will show the other allocations that this resource is aliased with. If you see an allocation in the GPU process, the memory is generally GPU memory. Otherwise, the resource is typically Shared Memory.
Tile and Staging memory managers are set up to evict any resource not used within 1s.
This category lists the memory allocations needed to support CC's GPU path. Despite the name, the data in this category (within a Renderer process) is not GPU memory but Shared Memory.
Allocations tracked here include GL command buffer support allocations such as:
Cached images make use of Discardable memory. These allocations are managed by Skia and a better summary of these allocations can likely be found in the Skia category.
The malloc category shows a summary of all memory allocated through malloc.
Currently the information here is not granular enough to be useful, and a good project would be to track down and instrument any large pools of memory using malloc.
Some Skia caches also make use of malloc memory. For these allocations, a better summary can be seen in the Skia category.
The Skia category shows all resources used by the Skia rendering system. These can be divided into a few subcategories. skia/gpu_resources/* includes all resources using GPU memory. All other categories draw from either Shared or malloc memory. To determine which type of memory a resource is using, hover over the green arrow next to its size. This will show the other allocations which the resource is aliased with.
Many of the allocations under CC are aliased with memory in the Browser or GPU process. When investigating CC memory it may be worth looking at the following external categories:
The following areas have insufficient memory instrumentation.