Closed Bug 783227 Opened 12 years ago Closed 12 years ago

dump() about:memory text for mobile debugging

Categories

(Toolkit :: about:memory, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 768470

People

(Reporter: gbrown, Assigned: gbrown)

Details

(Whiteboard: [MemShrink])

Attachments

(1 file)

about:memory is a great tool, but I find it awkward to use on Android because:
 - there's a lot of text to display on a phone screen...I end up panning and zooming all over the place to read it
 - it's difficult to copy/paste to email/irc/bugzilla on desktop

By dump()'ing the about:memory text, it appears in the Android logcat -- easy to read or copy/paste on desktop.

Here's a sample:

I/GeckoDump(24267): Main Process
I/GeckoDump(24267): 
I/GeckoDump(24267): Explicit Allocations
I/GeckoDump(24267): 26.46 MB (100.0%) -- explicit
I/GeckoDump(24267): ├──12.29 MB (46.45%) -- js-non-window
I/GeckoDump(24267): │  ├───5.84 MB (22.08%) -- compartments
I/GeckoDump(24267): │  │   ├──5.24 MB (19.81%) -- non-window-global
I/GeckoDump(24267): │  │   │  ├──3.41 MB (12.87%) ++ (37 tiny)
I/GeckoDump(24267): │  │   │  │  ├──0.23 MB (00.85%) ++ compartment([System Principal], jar:jar:file:///data/app/org.mozilla.fennec_mozdev-1.apk!/omni.ja!/components/nsLoginManager.js)
I/GeckoDump(24267): │  │   │  │  │  ├──0.13 MB (00.47%) ── analysis-temporary
I/GeckoDump(24267): │  │   │  │  │  ├──0.07 MB (00.27%) ++ gc-heap
I/GeckoDump(24267): │  │   │  │  │  │  ├──0.04 MB (00.15%) ── unused-gc-things
I/GeckoDump(24267): │  │   │  │  │  │  ├──0.02 MB (00.08%) ── sundries
I/GeckoDump(24267): │  │   │  │  │  │  └──0.01 MB (00.03%) ── shapes/tree
I/GeckoDump(24267): │  │   │  │  │  ├──0.02 MB (00.07%) ── script-data
I/GeckoDump(24267): │  │   │  │  │  └──0.01 MB (00.05%) ── other-sundries
I/GeckoDump(24267): │  │   │  │  ├──0.22 MB (00.84%) ++ compartment([System Principal], resource://gre/modules/NetUtil.jsm)
I/GeckoDump(24267): │  │   │  │  │  ├──0.13 MB (00.47%) ── analysis-temporary
I/GeckoDump(24267): │  │   │  │  │  ├──0.05 MB (00.21%) ++ gc-heap
I/GeckoDump(24267): │  │   │  │  │  │  ├──0.04 MB (00.14%) ── unused-gc-things
I/GeckoDump(24267): │  │   │  │  │  │  └──0.02 MB (00.07%) ── sundries
I/GeckoDump(24267): │  │   │  │  │  ├──0.03 MB (00.11%) ── string-chars
I/GeckoDump(24267): │  │   │  │  │  └──0.01 MB (00.05%) ── other-sundries
I/GeckoDump(24267): │  │   │  │  ├──0.22 MB (00.83%) ++ compartment([System Principal], jar:jar:file:///data/app/org.mozilla.fennec_mozdev-1.apk!/omni.ja!/components/nsUpdateTimerManager.js)
I/GeckoDump(24267): │  │   │  │  │  ├──0.13 MB (00.47%) ── analysis-temporary
I/GeckoDump(24267): │  │   │  │  │  ├──0.07 MB (00.28%) ++ gc-heap
I/GeckoDump(24267): │  │   │  │  │  │  ├──0.04 MB (00.16%) ── unused-gc-things
I/GeckoDump(24267): │  │   │  │  │  │  ├──0.01 MB (00.04%) ── sundries
I/GeckoDump(24267): │  │   │  │  │  │  ├──0.01 MB (00.04%) ── objects/function
I/GeckoDump(24267): │  │   │  │  │  │  └──0.01 MB (00.04%) ── shapes/tree
I/GeckoDump(24267): │  │   │  │  │  └──0.02 MB (00.08%) ── other-sundries
I/GeckoDump(24267): │  │   │  │  ├──0.18 MB (00.69%) ++ compartment([System Principal], resource://gre/modules/FileUtils.jsm)
I/GeckoDump(24267): │  │   │  │  │  ├──0.13 MB (00.47%) ── analysis-temporary
I/GeckoDump(24267): │  │   │  │  │  ├──0.05 MB (00.19%) ++ gc-heap
I/GeckoDump(24267): │  │   │  │  │  │  ├──0.04 MB (00.14%) ── unused-gc-things
I/GeckoDump(24267): │  │   │  │  │  │  └──0.01 MB (00.05%) ── sundries
I/GeckoDump(24267): │  │   │  │  │  └──0.01 MB (00.03%) ── other-sundries
I/GeckoDump(24267): │  │   │  │  ├──0.18 MB (00.69%) ++ compartment([System Principal], jar:jar:file:///data/app/org.mozilla.fennec_mozdev-1.apk!/omni.ja!/components/DirectoryProvider.js)
I/GeckoDump(24267): │  │   │  │  │  ├──0.13 MB (00.47%) ── analysis-temporary
I/GeckoDump(24267): │  │   │  │  │  ├──0.05 MB (00.19%) ++ gc-heap
I/GeckoDump(24267): │  │   │  │  │  │  ├──0.04 MB (00.15%) ── unused-gc-things
I/GeckoDump(24267): │  │   │  │  │  │  └──0.01 MB (00.04%) ── sundries
I/GeckoDump(24267): │  │   │  │  │  └──0.01 MB (00.03%) ── other-sundries
I/GeckoDump(24267): │  │   │  │  ├──0.15 MB (00.58%) ++ compartment([System Principal], resource://gre/modules/AddonManager.jsm)
I/GeckoDump(24267): │  │   │  │  │  ├──0.11 MB (00.40%) ++ gc-heap
I/GeckoDump(24267): │  │   │  │  │  │  ├──0.05 MB (00.19%) ── unused-gc-things
I/GeckoDump(24267): │  │   │  │  │  │  ├──0.02 MB (00.06%) ── scripts
I/GeckoDump(24267): │  │   │  │  │  │  ├──0.01 MB (00.06%) ── sundries
I/GeckoDump(24267): │  │   │  │  │  │  ├──0.01 MB (00.05%) ── objects/function
I/GeckoDump(24267): │  │   │  │  │  │  └──0.01 MB (00.05%) ── shapes/tree
I/GeckoDump(24267): │  │   │  │  │  ├──0.03 MB (00.12%) ── script-data
I/GeckoDump(24267): │  │   │  │  │  └──0.02 MB (00.07%) ── other-sundries
I/GeckoDump(24267): │  │   │  │  ├──0.13 MB (00.49%) ++ compartment([System Pri
I/GeckoDump(24267): Other Measurements
I/GeckoDump(24267): 48 (100.0%) -- js-compartments
I/GeckoDump(24267): ├──45 (93.75%) ── system
I/GeckoDump(24267): └───3 (06.25%) ── user
I/GeckoDump(24267): 13.78 MB (100.0%) -- js-main-runtime
I/GeckoDump(24267): ├───7.34 MB (53.22%) -- compartments
I/GeckoDump(24267): │   ├──3.67 MB (26.64%) -- gc-heap
I/GeckoDump(24267): │   │  ├──1.79 MB (13.00%) ── unused-gc-things
I/GeckoDump(24267): │   │  ├──0.65 MB (04.69%) -- shapes
I/GeckoDump(24267): │   │  │  ├──0.40 MB (02.88%) ── tree
I/GeckoDump(24267): │   │  │  ├──0.15 MB (01.07%) ── base
I/GeckoDump(24267): │   │  │  └──0.10 MB (00.74%) ── dict
I/GeckoDump(24267): │   │  ├──0.61 MB (04.39%) -- objects
I/GeckoDump(24267): │   │  │  ├──0.37 MB (02.71%) ── function
I/GeckoDump(24267): │   │  │  └──0.23 MB (01.68%) ── non-function
I/GeckoDump(24267): │   │  ├──0.30 MB (02.20%) ── strings
I/GeckoDump(24267): │   │  ├──0.27 MB (01.98%) ── scripts
I/GeckoDump(24267): │   │  └──0.05 MB (00.38%) ++ (3 tiny)
I/GeckoDump(24267): │   │     ├──0.03 MB (00.20%) ── type-objects
I/GeckoDump(24267): │   │     ├──0.02 MB (00.17%) ── arena-admin
I/GeckoDump(24267): │   │     └──0.00 MB (00.00%) ── sundries
I/GeckoDump(24267): │   ├──1.75 MB (12.67%) ── analysis-temporary
I/GeckoDump(24267): │   ├──0.85 MB (06.15%) ── script-data
I/GeckoDump(24267): │   ├──0.41 MB (03.00%) ── string-chars
I/GeckoDump(24267): │   ├──0.33 MB (02.40%) -- shapes-extra
I/GeckoDump(24267): │   │  ├──0.19 MB (01.34%) ── compartment-tables
I/GeckoDump(24267): │   │  └──0.15 MB (01.05%) ++ (3 tiny)
I/GeckoDump(24267): │   │     ├──0.06 MB (00.45%) ── tree-shape-kids
I/GeckoDump(24267): │   │     ├──0.04 MB (00.31%) ── tree-tables
I/GeckoDump(24267): │   │     └──0.04 MB (00.30%) ── dict-tables
I/GeckoDump(24267): │   ├──0.24 MB (01.72%) ── objects/slots
I/GeckoDump(24267): │   └──0.09 MB (00.65%) ++ (4 tiny)
I/GeckoDump(24267): │      ├──0.05 MB (00.39%) ── cross-compartment-wrappers
I/GeckoDump(24267): │      ├──0.01 MB (00.11%) ── other-sundries
I/GeckoDump(24267): │      ├──0.01 MB (00.09%) ── mjit-data
I/GeckoDump(24267): │      └──0.01 MB (00.07%) ── type-inference/script-main
I/GeckoDump(24267): ├───5.12 MB (37.14%) ── runtime
I/GeckoDump(24267): └───1.33 MB (09.64%) -- gc-heap
I/GeckoDump(24267):     ├──1.25 MB (09.07%) ── decommitted-arenas
I/GeckoDump(24267):     └──0.08 MB (00.57%) ++ (3 tiny)
I/GeckoDump(24267):        ├──0.08 MB (00.57%) ── chunk-admin
I/GeckoDump(24267):        ├──0.00 MB (00.00%) ── unused-chunks
I/GeckoDump(24267):        └──0.00 MB (00.00%) ── unused-arenas
I/GeckoDump(24267): 3.75 MB (100.0%) -- js-main-runtime-gc-heap-committed
I/GeckoDump(24267): ├──1.96 MB (52.21%) -- used
I/GeckoDump(24267): │  ├──1.86 MB (49.48%) ── gc-things
I/GeckoDump(24267): │  ├──0.08 MB (02.08%) ── chunk-admin
I/GeckoDump(24267): │  └──0.02 MB (00.64%) ── arena-admin
I/GeckoDump(24267): └──1.79 MB (47.79%) -- unused
I/GeckoDump(24267):    ├──1.79 MB (47.79%) ── gc-things
I/GeckoDump(24267):    └──0.00 MB (00.00%) ++ (2 tiny)
I/GeckoDump(24267):       ├──0.00 MB (00.00%) ── chunks
I/GeckoDump(24267):       └──0.00 MB (00.00%) ── arenas
I/GeckoDump(24267): 0.49 MB (100.0%) -- window-objects
I/GeckoDump(24267): ├──0.46 MB (93.59%) -- layout
I/GeckoDump(24267): │  ├──0.40 MB (80.62%) ── style-sets
I/GeckoDump(24267): │  ├──0.05 MB (09.58%) ── pres-shell
I/GeckoDump(24267): │  ├──0.01 MB (02.34%) ++ (5 tiny)
I/GeckoDump(24267): │  │  ├──0.00 MB (00.93%) ── rule-nodes
I/GeckoDump(24267): │  │  ├──0.00 MB (00.79%) ── style-contexts
I/GeckoDump(24267): │  │  ├──0.00 MB (00.59%) ── frames
I/GeckoDump(24267): │  │  ├──0.00 MB (00.03%) ── line-boxes
I/GeckoDump(24267): │  │  └──0.00 MB (00.00%) ── text-runs
I/GeckoDump(24267): │  └──0.01 MB (01.06%) ── pres-contexts
I/GeckoDump(24267): ├──0.02 MB (04.52%) -- dom
I/GeckoDump(24267): │  ├──0.01 MB (03.01%) ── other
I/GeckoDump(24267): │  ├──0.01 MB (01.09%) ── element-nodes
I/GeckoDump(24267): │  └──0.00 MB (00.43%) ++ (3 tiny)
I/GeckoDump(24267): │     ├──0.00 MB (00.22%) ── text-nodes
I/GeckoDump(24267): │     ├──0.00 MB (00.21%) ── comment-nodes
I/GeckoDump(24267): │     └──0.00 MB (00.00%) ── cdata-nodes
I/GeckoDump(24267): ├──0.01 MB (01.74%) ── style-sheets
I/GeckoDump(24267): └──0.00 MB (00.15%) ── property-tables
I/GeckoDump(24267):  26.40 MB ── explicit
I/GeckoDump(24267):   0.00 MB ── gfx-surface-image
I/GeckoDump(24267):         0 ── ghost-windows
I/GeckoDump(24267):  17.33 MB ── heap-allocated
I/GeckoDump(24267):  18.04 MB ── heap-committed
I/GeckoDump(24267):   0.69 MB ── heap-committed-unused
I/GeckoDump(24267):     3.98% ── heap-committed-unused-ratio
I/GeckoDump(24267):   0.21 MB ── heap-dirty
I/GeckoDump(24267):   2.66 MB ── heap-unused
I/GeckoDump(24267):   0.00 MB ── images-content-used-uncompressed
I/GeckoDump(24267):   5.00 MB ── js-gc-heap
I/GeckoDump(24267):        50 ── page-faults-hard
I/GeckoDump(24267):    36,627 ── page-faults-soft
I/GeckoDump(24267):  85.35 MB ── resident
I/GeckoDump(24267):   1.79 MB ── storage-sqlite
I/GeckoDump(24267): 386.55 MB ── vsize
Attachment #652405 - Flags: review?(n.nethercote)
Whiteboard: [MemShrink]
See also bug 768470, which may be a dupe, but I think is slightly different.
Comment on attachment 652405 [details] [diff] [review]
simple patch to dump about:memory text

Review of attachment 652405 [details] [diff] [review]:
-----------------------------------------------------------------

The "I/GeckoDump(24267): " prefix must be auto-attached to all dump() output, is that right?

This works, but I have some reservations.

- Do we really want to unconditionally dump() the entire output of about:memory every time?  It can be 100s of KB in verbose mode.

- about:memory is carefully optimized to use as little memory as possible.  Concatenating all those strings into gDumpLine will use memory.  Is it possible to just dump each text fragment in appendTextNode() and avoid the concatenation?

- jlebar mentioned bug 768470.  Will this work on B2G?  If so, great.  If not, can we come up with a single mechanism that will be helpful on both Fennec and B2G?
Attachment #652405 - Flags: review?(n.nethercote) → review-
(In reply to Nicholas Nethercote [:njn] from comment #3)
> Comment on attachment 652405 [details] [diff] [review]
> simple patch to dump about:memory text
> 
> Review of attachment 652405 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> The "I/GeckoDump(24267): " prefix must be auto-attached to all dump()
> output, is that right?

Correct. I copied that directly from logcat. "I/" indicates its an "info" type message; "24267" was the pid.

> This works, but I have some reservations.
> 
> - Do we really want to unconditionally dump() the entire output of
> about:memory every time?  It can be 100s of KB in verbose mode.

That's a fair concern; I'm not sure how to address it. Add a button? Limit the output to the first N lines? 

> - about:memory is carefully optimized to use as little memory as possible. 
> Concatenating all those strings into gDumpLine will use memory.  Is it
> possible to just dump each text fragment in appendTextNode() and avoid the
> concatenation?

I think that would result in line-breaks between each text fragment, at least in logcat. It should be possible to limit the concatenation to each line though...I will check in to that.

> - jlebar mentioned bug 768470.  Will this work on B2G?  If so, great.  If
> not, can we come up with a single mechanism that will be helpful on both
> Fennec and B2G?

I don't know how this will work for B2G; hopefully jlebar can comment.
> I don't know how this will work for B2G; hopefully jlebar can comment.

We can't even open about:memory in b2g.  But presuming we could, yes, this would work.

I'd rather have a button in about:memory which dumps the contents, so we don't perturb our measurements.  Or at the very least, we could pref this on only for Android.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: