Open Bug 1200812 Opened 9 years ago Updated 3 years ago

Add memory reporting for typed event handlers

Categories

(Core :: DOM: Events, defect, P5)

defect

Tracking

()

Tracking Status
firefox43 --- affected

People

(Reporter: mccr8, Unassigned)

Details

(Whiteboard: [MemShrink:P2])

I noticed this in a DMD report from the test case in bug 1156484 comment 17:

Unreported {
  ~331 blocks in heap block record 4 of 2,715
  ~1,354,783 bytes (~1,354,783 requested / ~0 slop)
  Individual block sizes: ~4,093 x 331
  0.43% of the heap (5.82% cumulative)
  2.66% of unreported (35.70% cumulative)
  Allocated at {
    #01: replace_malloc (DMD.cpp:1233, in libdmd.dylib)
    #02: moz_xmalloc (mozalloc.cpp:84, in libmozglue.dylib)
    #03: mozilla::dom::HTMLElementBinding::set_onclick(JSContext*, JS::Handle<JSObject*>, nsGenericHTMLElement*, JSJitSetterCallArgs) (mozalloc.h:186, in XUL)
  }
}

This allocation is an EventHandlerNonNull.

Olli said JSEventHandler::SizeOfExcludingThis should report the size of mTypedHandler.On*EventHandler, then add a size of method to TypedEventHandler, which could check the Type() and based on that report the size of the thing it holds onto. The event handler is refcounted, so other things could own it, but the JSEventHandler is the canonical owner, it sounds like, so the refcount doesn't need to be checked.
Whiteboard: [MemShrink] → [MemShrink:P2]

Bulk-downgrade of unassigned, >=3 years untouched DOM/Storage bug's priority.

If you have reason to believe this is wrong, please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.