lib/third_party/tracing/model/global_memory_dump.js
function() {
      // 1. Calculate not-owned and not-owning sub-sizes of all MADs
      // (depth-first post-order traversal).
      this.traverseAllocatorDumpsInDepthFirstPostOrder(
          this.calculateDumpSubSizes_.bind(this));

      // 2. Calculate owned and owning coefficients of owned and owner MADs
      // respectively (arbitrary traversal).
      this.traverseAllocatorDumpsInDepthFirstPostOrder(
          this.calculateDumpOwnershipCoefficient_.bind(this));

      // 3. Calculate cumulative owned and owning coefficients of all MADs
      // (depth-first pre-order traversal).
      this.traverseAllocatorDumpsInDepthFirstPreOrder(
          this.calculateDumpCumulativeOwnershipCoefficient_.bind(this));

      // 4. Calculate the effective sizes of all MADs (depth-first post-order
      // traversal).
      this.traverseAllocatorDumpsInDepthFirstPostOrder(
          this.calculateDumpEffectiveSize_.bind(this));
    }
function() {
      // 1. Calculate not-owned and not-owning sub-sizes of all MADs
      // (depth-first post-order traversal).
      this.traverseAllocatorDumpsInDepthFirstPostOrder(
          this.calculateDumpSubSizes_.bind(this));

      // 2. Calculate owned and owning coefficients of owned and owner MADs
      // respectively (arbitrary traversal).
      this.traverseAllocatorDumpsInDepthFirstPostOrder(
          this.calculateDumpOwnershipCoefficient_.bind(this));

      // 3. Calculate cumulative owned and owning coefficients of all MADs
      // (depth-first pre-order traversal).
      this.traverseAllocatorDumpsInDepthFirstPreOrder(
          this.calculateDumpCumulativeOwnershipCoefficient_.bind(this));

      // 4. Calculate the effective sizes of all MADs (depth-first post-order
      // traversal).
      this.traverseAllocatorDumpsInDepthFirstPostOrder(
          this.calculateDumpEffectiveSize_.bind(this));
    }
function ( ) { // 1. Calculate not-owned and not-owning sub-sizes of all MADs // (depth-first post-order traversal). this . traverseAllocatorDumpsInDepthFirstPostOrder ( this . calculateDumpSubSizes_ . bind ( this ) ) ; // 2. Calculate owned and owning coefficients of owned and owner MADs // respectively (arbitrary traversal). this . traverseAllocatorDumpsInDepthFirstPostOrder ( this . calculateDumpOwnershipCoefficient_ . bind ( this ) ) ; // 3. Calculate cumulative owned and owning coefficients of all MADs // (depth-first pre-order traversal). this . traverseAllocatorDumpsInDepthFirstPreOrder ( this . calculateDumpCumulativeOwnershipCoefficient_ . bind ( this ) ) ; // 4. Calculate the effective sizes of all MADs (depth-first post-order // traversal). this . traverseAllocatorDumpsInDepthFirstPostOrder ( this . calculateDumpEffectiveSize_ . bind ( this ) ) ; }
Calculate the effective size of all memory allocator dumps in the dump
graph.

The effective size refers to the amount of memory a particular component
is using/consuming. In other words, every (reported) byte of used memory
is uniquely attributed to exactly one component. Consequently, unlike
size, effective size is cumulative, i.e. the sum of the effective sizes
of (top-level) components is equal to the total amount of (reported)
used memory.

Metric motivation: "How much memory does a (sub)system use?" or "For how
much memory should a (sub)system be 'charged'?"

Please refer to the Memory Dump Graph Metric Calculation design document
for more details (https://goo.gl/fKg0dt).

This method assumes that the size of all contained memory allocator
dumps has already been calculated [see calculateSizes()].
Calculate the effective size of all memory allocator dumps in the dump graph .