Closed Bug 755581 Opened 12 years ago Closed 12 years ago

Some extra post-CPG memory reporters for JS

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

(Whiteboard: [MemShrink:P2])

Attachments

(5 files)

This will cover things like JSCompartment objects, and cross-compartment wrappers.
Blocks: 752865
This reduces some unnecessary tree nesting in about:memory.  This:

│  │   ├─────193,200 B (00.05%) -- mjit
│  │   │     └──193,200 B (00.05%) ── data [12]

Becomes this:

│  │   ├─────193,200 B (00.05%) -- mjit-data [12]

The nested version made sense when mjit-code was stored in the compartment,
but it's now in the runtime.
Attachment #624260 - Flags: review?(luke)
The "runtime/normal" entry in about:memory only measures DtoaState, so let's
change it to "runtime/dtoa".
Attachment #624261 - Flags: review?(luke)
Attachment #624260 - Flags: review?(luke) → review+
Attachment #624261 - Flags: review?(luke) → review+
JSRuntime::sizeOfIncludingThis() is getting unwieldy.  This patch puts all
those parameters into a struct.  It also moves the measurement of a couple
of JSRuntime-related sizes into JSRuntime::sizeOfIncludingThis().
Attachment #624265 - Flags: review?(luke)
This patch adds reporters for the mathCache, ScriptFilenameTable, and 
JSCompartment objects.  The latter is the biggest, 200KB+ at start-up on 64-bit.
Attachment #624267 - Flags: review?(luke)
This is usually tiny (e.g. 1KB per compartment), but it's a good reporter to have because it might blow out on occasion.
Attachment #624269 - Flags: review?(luke)
Comment on attachment 624265 [details] [diff] [review]
Patch 3: Clean up JSRuntime::sizeOfIncludingThis()

Looks better
Attachment #624265 - Flags: review?(luke) → review+
Attachment #624267 - Flags: review?(luke) → review+
Attachment #624269 - Flags: review?(luke) → review+
Five reviews in under an hour... thanks!  \o/
Comment on attachment 624265 [details] [diff] [review]
Patch 3: Clean up JSRuntime::sizeOfIncludingThis()

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

::: js/public/MemoryMetrics.h
@@ +152,5 @@
>        , currCompartmentStats(NULL)
>        , mallocSizeOf(mallocSizeOf)
>      {}
>  
> +    js::RuntimeSizes runtime;

Should be JS::...
> > +    js::RuntimeSizes runtime;
> 
> Should be JS::...

Nice catch.  I was wondering how that even compiled, when Luke told me we have this:

  namespace js { using namespace JS }

I changed it.  Thanks!

https://hg.mozilla.org/integration/mozilla-inbound/rev/dcd6365a8255
You need to log in before you can comment on or make changes to this bug.