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

Issue 705785 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug
Hotlist-MemoryInfra



Sign in to add a comment

Add a memory dump provider for Mojo

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

Issue description

Memory dump providers emit information about Chrome subsystems, making it easier to understand how much memory the subsystem is using, and frequently make it easier to find and diagnose leaks. 

https://chromium.googlesource.com/chromium/src/+/master/docs/memory-infra/README.md

I think it would be helpful we added a memory dump provider for Mojo, possibly counting connections, messages, and handles. Really whatever the Mojo team thinks is relevant.

context:
https://bugs.chromium.org/p/chromium/issues/detail?id=704938#c13


 
+1, I would be supportive even if we end up with a memory dump provider which does not expose any "bytes" count (if there are too many structs and things hard to follow) but reports at least cardinalities of things, so we can keep track if number of messages/handles and such grows without any limit.

Comment 2 by roc...@chromium.org, May 29 2017

Cc: roc...@chromium.org
Owner: ----
Status: Available (was: Assigned)
Owner: erikc...@chromium.org
Status: Assigned (was: Available)
rockot@ says the most relevant object to count is message-pipes, and it should be pretty straight forward to hook up a MDP. I can take a stab at this.
Thanks for looking. All Mojo handles are ultimately added to the global
HandleTable[1], so that object should probably be the MDP.

Note that there are a few methods there which modify handles_. It is safe
to assume that we do not leak Dispatcher instances as the HandleTable is
their only persistent reference holder over time.

Dispatcher::type() will tell you what kind of dispatcher it is. You could
just track MESSAGE_PIPE dispatchers, or track all of them, broken down by
type, if you think that's useful and straightforward enough.

[1]
https://cs.chromium.org/chromium/src/mojo/edk/system/handle_table.h?rcl=cf255632485f5f62553bbc8ca434e116c7d60f14&l=20
Cc: ssid@chromium.org dskiba@chromium.org
Nice!

Does it surface number of endpoints? Previously we saw that some of our EM stories have abnormal number of them, causing excessive std::deque memory usage ( issue 719774 ).

I have two implementation-wise suggestions:

1. Transpose values. Right now the code creates a column per dispatcher type, but it would be more convenient to create a value per type instead (i.e. dump "mojo/<dispatcher type>" values). Two advantages: easier to read, and compatible with slow reports.

2. Once (1) is done, this MDP can be whitelisted in the slow reports (go/slow-memory-reports), providing interesting insights from the field. 




@dskiba: on it.
Project Member

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

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

commit bf2cf91d6a8240cf080cceb53bc489cce7826c02
Author: erikchen <erikchen@chromium.org>
Date: Tue Jun 06 23:54:41 2017

Change format of data emitted in MemoryDumpProvider.

This CL changes the data from a column per dispatcher type to a value per
dispatcher type, which is easier to read and allows for integration with slow
reports.

BUG=705785

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

[modify] https://crrev.com/bf2cf91d6a8240cf080cceb53bc489cce7826c02/mojo/edk/system/handle_table.cc

Project Member

Comment 10 by bugdroid1@chromium.org, Jun 9 2017

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

commit 30661e1351e5de95f097bdf40854337200a56d7c
Author: erikchen <erikchen@chromium.org>
Date: Fri Jun 09 21:56:20 2017

Correctly initialize MemoryDumpArgs in the MojoHandleTable test.

BUG=705785

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

[modify] https://crrev.com/30661e1351e5de95f097bdf40854337200a56d7c/mojo/edk/system/handle_table_unittest.cc

Cc: -roc...@chromium.org rockot@google.com

Sign in to add a comment