Closed Bug 1350286 Opened 7 years ago Closed 7 years ago

Memory allocated by NurseryAwareHashMap is not tracked in about:memory (detected by DMD in heap-unclassifieds)

Categories

(Core :: JavaScript: GC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: jujjyl, Assigned: jonco)

Details

Attachments

(2 files)

STR:

1. Do a DMD build of Firefox from https://developer.mozilla.org/en-US/docs/Mozilla/Performance/DMD
2. Visit http://mzl.la/webassemblydemo
3. Run a snapshot and analyze the main process

Looking at the heap-unclassifieds of the main process, there are 43 allocations coming from this call site:

js::NurseryAwareHashMap<js::CrossCompartmentKey,JS::Value,js::CrossCompartmentKey::Hasher,js::SystemAllocPolicy>::put (e:\gecko-dev\js\src\gc\nurseryawarehashmap.h:119)

Full call stack looking like

Unreported {
  8 blocks in heap block record 4 of 8,111
  423,168 bytes (423,168 requested / 0 slop)
  Individual block sizes: 262,144; 131,072; 16,384; 8,192; 2,048 x 2; 1,024; 256
  0.53% of the heap (10.31% cumulative)
  2.14% of unreported (41.69% cumulative)
  Allocated at {
    #01: mozilla::detail::VectorImpl<js::CrossCompartmentKey,0,js::SystemAllocPolicy,0>::growTo (e:\gecko-dev\obj-x86_64-pc-mingw32\dist\include\mozilla\vector.h:137)
    #02: js::NurseryAwareHashMap<js::CrossCompartmentKey,JS::Value,js::CrossCompartmentKey::Hasher,js::SystemAllocPolicy>::put (e:\gecko-dev\js\src\gc\nurseryawarehashmap.h:119)
    #03: JSCompartment::getOrCreateWrapper (e:\gecko-dev\js\src\jscompartment.cpp:441)
    #04: JSCompartment::wrap (e:\gecko-dev\js\src\jscompartment.cpp:479)
    #05: JSCompartment::wrap (e:\gecko-dev\js\src\jscompartmentinlines.h:134)
    #06: js::CrossCompartmentWrapper::call (e:\gecko-dev\js\src\proxy\crosscompartmentwrapper.cpp:357)
    #07: js::Proxy::call (e:\gecko-dev\js\src\proxy\proxy.cpp:465)
    #08: js::proxy_Call (e:\gecko-dev\js\src\proxy\proxy.cpp:716)
    #09: js::InternalCallOrConstruct (e:\gecko-dev\js\src\vm\interpreter.cpp:436)
    #10: js::jit::DoCallFallback (e:\gecko-dev\js\src\jit\baselineic.cpp:2352)
    #11: ??? (???:???)
  }
}

This is third highest untracked memory usage on that page in the main process, so it would be good to get this tracked under about:memory?

Attached a DMD report.
It seems like this should fix things.
Assignee: nobody → jcoppeard
Attachment #8851590 - Flags: review?(sphink)
Comment on attachment 8851590 [details] [diff] [review]
bug1350286-wrapper-map-size

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

Well, that's straightforward.
Attachment #8851590 - Flags: review?(sphink) → review+
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/037f5bf0ee0a
Report size of nursery entries vector for NurseryAwayreHashMap r=sfink
https://hg.mozilla.org/mozilla-central/rev/037f5bf0ee0a
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: