Last Comment Bug 515354 - Implement "about:memory"
: Implement "about:memory"
[parity Chrome]
: dev-doc-complete, user-doc-needed
Product: Toolkit
Classification: Components
Component: about:memory (show other bugs)
: Trunk
: x86 All
-- enhancement with 4 votes (vote)
: ---
Assigned To: Vladimir Vukicevic [:vlad] [:vladv]
: Nicholas Nethercote [:njn]
Depends on: 515556 520364 520422 520467 534848
Blocks: 400120 167035
  Show dependency treegraph
Reported: 2009-09-09 06:59 PDT by RNicoletto
Modified: 2012-12-04 08:26 PST (History)
28 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Google Chrome 3.x "about:memory" page (73.90 KB, image/png)
2009-09-09 06:59 PDT, RNicoletto
no flags Details
export jemalloc.h and jemalloc_stats symbol (1.37 KB, patch)
2009-09-15 14:46 PDT, Vladimir Vukicevic [:vlad] [:vladv]
ted: review+
Details | Diff | Splinter Review
about:memory (23.17 KB, patch)
2009-09-15 14:48 PDT, Vladimir Vukicevic [:vlad] [:vladv]
mconnor: review+
mbeltzner: approval1.9.2+
Details | Diff | Splinter Review
screenshot (90.87 KB, image/png)
2009-09-15 15:11 PDT, Vladimir Vukicevic [:vlad] [:vladv]
no flags Details
VC8 CRT patch patch (1.07 KB, patch)
2009-09-28 11:14 PDT, Ted Mielczarek [:ted.mielczarek]
no flags Details | Diff | Splinter Review

Description User image RNicoletto 2009-09-09 06:59:15 PDT
Created attachment 399464 [details]
Google Chrome 3.x "about:memory" page

One of the greatest features of Google Chrome is the "about:memory" page and I would like to see something similar in Mozilla Firefox.

Refer to bug 515352 description for more details about this enhancement request.

Just for reference: Memory Usage Backgrounder - Chromium Memory Usage (
Comment 1 User image (mostly gone) XtC4UaLL [:xtc4uall] 2009-09-09 15:01:05 PDT
related Bugs:
Bug 392351 and dependencies
Bug 400120
Bug 453420 comment 3
Comment 2 User image RNicoletto 2009-09-09 22:41:08 PDT
Added another bug dependecy:
Bug 167035
Comment 3 User image Benjamin Smedberg [:bsmedberg] 2009-09-14 14:23:28 PDT
*** Bug 515352 has been marked as a duplicate of this bug. ***
Comment 4 User image Vladimir Vukicevic [:vlad] [:vladv] 2009-09-15 14:46:10 PDT
Created attachment 400872 [details] [diff] [review]
export jemalloc.h and jemalloc_stats symbol

This only changes the VC9 jemalloc patch; we need something else that will change the VC8 one.  This is a requirement for the following patch.
Comment 5 User image Vladimir Vukicevic [:vlad] [:vladv] 2009-09-15 14:48:39 PDT
Created attachment 400875 [details] [diff] [review]

Simple about:memory implementation.  Displays a page that basically dumps all the reporters when refreshed.  Should be good enough to build on top of.

We'll have to figure out localization; I'm thinking that we support a properties file where we look up the reporter path ("malloc/committed"), and if a string for that is present, we use that -- otherwise we use the path itself.
Comment 6 User image Vladimir Vukicevic [:vlad] [:vladv] 2009-09-15 15:11:50 PDT
Created attachment 400878 [details]

Screenshot of what this looks like.  Note that jemalloc is giving some bogus numbers currently.
Comment 7 User image Vladimir Vukicevic [:vlad] [:vladv] 2009-09-22 13:11:38 PDT
Comment on attachment 400872 [details] [diff] [review]
export jemalloc.h and jemalloc_stats symbol

Ted, is exporting jemalloc.h in this way ok?  Seems to work fine.

Er, I have no idea why this patch removed the header from the _sample_.rc diff.  Ignore that hunk.
Comment 8 User image Mike Connor [:mconnor] 2009-09-22 20:50:08 PDT
Comment on attachment 400875 [details] [diff] [review]

>diff --git a/toolkit/components/aboutmemory/content/aboutMemory.js b/toolkit/components/aboutmemory/content/aboutMemory.js

code looks fine, there's random tab chars in places (noticed since diff indentation was wacky)

>+function doLoad()

as noted, this isn't needed anymore.

this looks good overall, woo!

Comment 9 User image Ted Mielczarek [:ted.mielczarek] 2009-09-25 13:30:20 PDT
Comment on attachment 400872 [details] [diff] [review]
export jemalloc.h and jemalloc_stats symbol

Seems sane. Remember to put the crt patch license header back in before landing. Also, I'll get you a VC8 version of this soon, I promise.
Comment 10 User image Mike Beltzner [:beltzner, not reading bugmail] 2009-09-25 14:26:32 PDT
Any chance of getting this as an XPI for 3.6? I'm almost willing to land this in all locales with en-US strings, really.
Comment 11 User image Ted Mielczarek [:ted.mielczarek] 2009-09-28 11:14:35 PDT
Created attachment 403280 [details] [diff] [review]
VC8 CRT patch patch

This is an equivalent patch for the VC8 CRT patch. There's some extra changes (in there that I don't fully understand (but look harmless, and build fine), so if you want to be extra paranoid, I think you can actually just hand-edit crtvc8sp1.diff, and add that jemalloc_stats line directly below malloc_usable_size.
Comment 12 User image Ted Mielczarek [:ted.mielczarek] 2009-09-28 11:15:37 PDT
Might be stray whitespace junk from previous fiddling, I would recommend just hand-editing the VC8 patch. You can probably tryserver it to sanity check yourself.
Comment 13 User image Vladimir Vukicevic [:vlad] [:vladv] 2009-10-01 23:14:11 PDT
So this all works great on Windows, but on Linux the libxul link fails -- it can't find jemalloc_stats.  Indeed, we don't actually link jemalloc into libxul, but instead link it directly to the browser app.  Is there any reason we do this?  Can we just make it part of libxul?
Comment 14 User image Benjamin Smedberg [:bsmedberg] 2009-10-02 05:37:06 PDT
Yes, the reason is that if you make jemalloc part of libxul you totally screw over all the embedders who will end up with mixed allocators (you end up replacing malloc/free midway through running their app).
Comment 15 User image Vladimir Vukicevic [:vlad] [:vladv] 2009-10-03 02:33:59 PDT
Checked in, disabled on Linux due to linkage issues.  On Mac, it reports the OSX allocator's zone 0 stats.
Comment 16 User image Doug Turner (:dougt) 2009-10-03 07:54:10 PDT
vlad, can we get this for 192?
Comment 17 User image u88484 2009-10-03 12:37:55 PDT
What are the values measure in? Bytes, MB, K, KB, GB?
Comment 18 User image Jo Hermans 2009-10-03 16:43:23 PDT
Some of these figures are really bogus. I watched the 'memory mapped' counter going to 0, and then it became negative :

Memory mapped:	4,284,481,536
Memory in use:	100,894,418
malloc/allocated 100,903,002
malloc/mapped 4,284,481,536
malloc/committed 39,411,712
malloc/dirty 2,895,872
Comment 19 User image Vladimir Vukicevic [:vlad] [:vladv] 2009-10-05 00:26:02 PDT
The bogus values are known -- there's a jemalloc stats bug, but it'll be fixed separately... bug 515556.
Comment 20 User image PikeUK 2009-10-07 02:13:40 PDT
There's a typo in the tooltip text, commited instead of committed.
Comment 21 User image Tyler Downer [:Tyler] 2009-10-07 07:29:15 PDT
Committed is the EN-US spelling I believe. For EN-UK, it is probably commited.
Comment 22 User image Reed Loden [:reed] (use needinfo?) 2009-10-07 07:55:16 PDT
(In reply to comment #20)
> There's a typo in the tooltip text, commited instead of committed.

Fixed --
Comment 23 User image Mike Beltzner [:beltzner, not reading bugmail] 2009-10-07 11:20:59 PDT
Vlad: any chance you can help describe in human terms what the values are so that the SUMO and MDC guys can write this up?
Comment 25 User image Damon Sicore (:damons) 2009-10-08 11:17:44 PDT
Is this really resolved/fixed if it isn't implemented on Linux?
Comment 26 User image Biju 2009-10-09 17:49:36 PDT
An enhancement request bug 521522 
-  about:memory should automatically refresh every 5 sec (configurable)
Comment 27 User image Mike Beltzner [:beltzner, not reading bugmail] 2009-10-26 07:34:44 PDT
(In reply to comment #25)
> Is this really resolved/fixed if it isn't implemented on Linux?

A follow up should be levied against implementing it on all other platforms: Linux, Maemo, WinCE
Comment 28 User image Chris Ilias [:cilias] 2009-11-20 01:25:02 PST
I think this would be an ideal addition to the support article <>, but when I look at about:memory, I have no idea how to use this feature. Can someone tell me?
Comment 29 User image Eric Shepherd [:sheppy] 2010-03-11 13:29:14 PST
Added a mention of this here:

Note You need to log in before you can comment on or make changes to this bug.