New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 707019 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android
Pri: 1
Type: Bug
Hotlist-MemoryInfra



Sign in to add a comment

Implement fast and slow computations for Private Memory Footprint on Linux.

Project Member Reported by erikc...@chromium.org, Mar 30 2017

Issue description

Fast computation uses private resident + compressed/swapped.
Slow computation walks all memory regions to collect detailed stats.
 
Cc: hjd@chromium.org
Owner: hjd@chromium.org
hjd is doing some experiments here correlating the full computation from /proc/pid/smaps with the fast approximation from /proc/pid/{statm,status} as described in the doc #1.

Comment 3 by hjd@chromium.org, Apr 5 2017

Status: Started (was: Assigned)

Comment 4 by hjd@chromium.org, Apr 5 2017

Primiano and I experimented. Still finalizing the doc but it seems like the fast calculation is a pretty good approximation. https://docs.google.com/document/d/1gF3JVf10J0xr2u13gNKWW63tMTMBrGG_aLzgS0XfdhE/edit# 
Project Member

Comment 6 by bugdroid1@chromium.org, May 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/90e0440fbcc073544c8645595268e641ad8e51a5

commit 90e0440fbcc073544c8645595268e641ad8e51a5
Author: hjd <hjd@chromium.org>
Date: Mon May 08 13:00:25 2017

Fill in PlatformPrivateFootprint on Linux 1/2

This CL populates the rss_anon_bytes field of the PlatformPrivateFootprint struct on Linux.

The struct contains platform specific numbers that will be used by the
memory-infra service to compute the private memory footprint of the
process.

BUG= 707019 

Review-Url: https://codereview.chromium.org/2839733004
Cr-Commit-Position: refs/heads/master@{#469968}

[modify] https://crrev.com/90e0440fbcc073544c8645595268e641ad8e51a5/base/trace_event/process_memory_totals.h
[modify] https://crrev.com/90e0440fbcc073544c8645595268e641ad8e51a5/components/tracing/common/process_metrics_memory_dump_provider.cc
[modify] https://crrev.com/90e0440fbcc073544c8645595268e641ad8e51a5/components/tracing/common/process_metrics_memory_dump_provider.h

Project Member

Comment 7 by bugdroid1@chromium.org, May 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bae6b3bcfa9dccd18b061beafcb17d0dbd39a7c9

commit bae6b3bcfa9dccd18b061beafcb17d0dbd39a7c9
Author: hjd <hjd@chromium.org>
Date: Wed May 17 04:18:05 2017

Fill in PlatformPrivateFootprint on Linux 2/2

This CL populates the vm_swap_bytes field of the PlatformPrivateFootprint
struct on Linux.

The struct contains platform specific numbers that will be used by the
memory-infra service to compute the private memory footprint of the
process.

BUG= 707019 

Review-Url: https://codereview.chromium.org/2866723002
Cr-Commit-Position: refs/heads/master@{#472321}

[modify] https://crrev.com/bae6b3bcfa9dccd18b061beafcb17d0dbd39a7c9/base/process/process_metrics.h
[modify] https://crrev.com/bae6b3bcfa9dccd18b061beafcb17d0dbd39a7c9/base/process/process_metrics_linux.cc
[modify] https://crrev.com/bae6b3bcfa9dccd18b061beafcb17d0dbd39a7c9/components/tracing/common/process_metrics_memory_dump_provider.cc

Comment 8 by hjd@chromium.org, May 17 2017

Status: Fixed (was: Started)
Cc: ssid@chromium.org dskiba@chromium.org
Are we always using fast method? I think slow method undercounts dalvik regions (/dev/ashmem/dalvik-), which are essentially anonymous. See implementation of MemMap::MapAnonymous(use_ashmem=true) in art/runtime/mem_map.cc.

Treating "/dev/ashmem/dalvik-" similarly to regions NOT starting with "/" in the script from the document reduces difference between fast and slow methods to 856K (from 2608K).
Labels: OS-Android

Sign in to add a comment