Closed Bug 697327 Opened 8 years ago Closed 8 years ago

Don't build Reporter objects in aboutMemory.js

Categories

(Toolkit :: about:memory, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED WONTFIX

People

(Reporter: njn, Assigned: njn)

References

Details

(Whiteboard: [MemShrink:P3])

Attachments

(1 file)

aboutMemory.js reads memory reporters and multi-reporters and creates an array of Reporter objects, one per measurement.  It then uses this array of Reporters to generate the trees and lists that are displayed.  It's possible to cut out the middle-man and generate the trees and lists directly;  I have an old patch doing this that I need to resurrect.  This should reduce the amount of memory used to generate about:memory, thus making it more accurate.
No longer blocks: 697041
Blocks: 697041
Not to suggest that this isn't worth doing, but I wonder how much of about:memory's effect is due to allocating objects.  I'd guess that the jit is responsible for more of the noise.

If we *really* wanted to make it not perturb things, we could rewrite the whole thing in C++.  I can't begin to fathom how much fun that would be.
And it's more complicated than comment 0 implies, now that I think about it.

aboutMemory.js has two basic stages:  data gathering, and data presentation.  Removing the Reporter array would make the data gathering step execute more JS, but the data presentation part would execute (and allocate) less.  That's bad if you load about:memory just once, because the JS numbers will be slightly inflated.  But it's good if you load about:memory lots of times, as is (more or less) done in the patch in bug 472209.
Attached patch old patchSplinter Review
Here's an old patch I have that does this, FWIW.  It's probably bit-rotted a bit.
Whiteboard: [MemShrink] → [MemShrink:P3]
> If we *really* wanted to make it not perturb things, we could rewrite the
> whole thing in C++.  I can't begin to fathom how much fun that would be.

True and true.  Bug 698846.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.