tools/android/native_lib_memory/parse_smaps.py
def _ComputeEstimatedFootprint(mappings, page_table_kb):
  """Returns the estimated footprint in kiB.

  Args:
    mappings: ([Mapping]) all process mappings.
    page_table_kb: (int) Sizeof the page tables in kiB.
  """
  footprint = page_table_kb
  for mapping in mappings:
    # Chrome shared memory.
    #
    # Even though it is shared memory, it exists because the process exists, so
    # account for its entirety.
    if mapping.pathname.startswith('/dev/ashmem/shared_memory'):
      footprint += mapping.fields['Rss']
    elif mapping.pathname.startswith('[anon'):
      footprint += _FootprintForAnonymousMapping(mapping)
    # Mappings without a name are most likely Chrome's native memory allocators:
    # v8, PartitionAlloc, Oilpan.
    # All of it should be charged to our process.
    elif mapping.pathname.strip() == '':
      footprint += mapping.fields['Rss']
    # Often inherited from the zygote, only count the private dirty part,
    # especially as the swap part likely comes from the zygote.
    elif mapping.pathname.startswith('['):
      footprint += mapping.fields['Private_Dirty']
    # File mappings. Can be a real file, and/or Dalvik/ART.
    else:
      footprint += mapping.fields['Private_Dirty']
  return footprint
Returns the estimated footprint in kiB.

  Args:
    mappings: ([Mapping]) all process mappings.
    page_table_kb: (int) Sizeof the page tables in kiB.
  
Returns the estimated footprint in kiB.
Returns the estimated footprint in kiB .
def _ComputeEstimatedFootprint(mappings, page_table_kb):
  footprint = page_table_kb
  for mapping in mappings:
     Even though it is shared memory, it exists because the process exists, so
     account for its entirety.
    if mapping.pathname.startswith('/dev/ashmem/shared_memory'):
      footprint += mapping.fields['Rss']
    elif mapping.pathname.startswith('[anon'):
      footprint += _FootprintForAnonymousMapping(mapping)
     Mappings without a name are most likely Chrome's native memory allocators:
     v8, PartitionAlloc, Oilpan.
     All of it should be charged to our process.
    elif mapping.pathname.strip() == '':
      footprint += mapping.fields['Rss']
     Often inherited from the zygote, only count the private dirty part,
     especially as the swap part likely comes from the zygote.
    elif mapping.pathname.startswith('['):
      footprint += mapping.fields['Private_Dirty']
     File mappings. Can be a real file, and/or Dalvik/ART.
    else:
      footprint += mapping.fields['Private_Dirty']
  return footprint
def _ComputeEstimatedFootprint ( mappings , page_table_kb ) : footprint = page_table_kb for mapping in mappings : if mapping . pathname . startswith ( '/dev/ashmem/shared_memory' ) : footprint += mapping . fields [ 'Rss' ] elif mapping . pathname . startswith ( '[anon' ) : footprint += _FootprintForAnonymousMapping ( mapping ) elif mapping . pathname . strip ( ) == '' : footprint += mapping . fields [ 'Rss' ] elif mapping . pathname . startswith ( '[' ) : footprint += mapping . fields [ 'Private_Dirty' ] else : footprint += mapping . fields [ 'Private_Dirty' ] return footprint
Returns the estimated footprint in kiB.
Returns the estimated footprint in kiB .
"""Returns the estimated footprint in kiB.

  Args:
    mappings: ([Mapping]) all process mappings.
    page_table_kb: (int) Sizeof the page tables in kiB.
  """ # Chrome shared memory. # # Even though it is shared memory, it exists because the process exists, so # account for its entirety. # Mappings without a name are most likely Chrome's native memory allocators: # v8, PartitionAlloc, Oilpan. # All of it should be charged to our process. # Often inherited from the zygote, only count the private dirty part, # especially as the swap part likely comes from the zygote. # File mappings. Can be a real file, and/or Dalvik/ART.
mappings
([Mapping]) all process mappings.
( [ Mapping ] ) all process mappings .
page_table_kb
(int) Sizeof the page tables in kiB.
( int ) Sizeof the page tables in kiB .