Closed Bug 700885 Opened 13 years ago Closed 7 years ago

Add memory reporter for binary input/output streams

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: n.nethercote, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [MemShrink:P2])

In bug 699801, a user with 5 add-ons installed (about:telemetry, add-on compatibility reporter, clear cache, cookie monster, and firebug) saw high heap-unclassified values, and the main culprit was 400MB in the following stack trace and tiny variations:

 Unreported: 34,603,296 (cumulative: 34,603,296) bytes in 15 heap block(s) in record 1 of 28498:
  Requested bytes unreported: 31,458,903 / 31,458,903
  Slop      bytes unreported: 3,144,393 / 3,144,393
    at 0x4C276AA: malloc (vg_replace_malloc.c:263)
    by 0x887F887: NS_Alloc_P (nsMemoryImpl.cpp:198)
    by 0x886254C: nsBinaryInputStream::ReadBytes(...) (nsMemory.h:68)
    by 0x888704E: NS_InvokeByIndex_P (xptcinvoke_x86_64_unix.cpp:195)
    by 0x85144B0: XPCWrappedNative::CallMethod(...) (XPCWrappedNative.cpp:2882)
    by 0x8518844: XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*) (XPCWrappedNativeJSOps.cpp:1554)
    by 0x8C3D46D: js::mjit::stubs::UncachedCallHelper(...) (jscntxtinlines.h:297)
    by 0x8C3D6CD: js::mjit::stubs::UncachedCall(...) (InvokeHelpers.cpp:433)
    by 0x1D9BBF1B: ???
    by 0x8BA6D13: js::mjit::EnterMethodJIT(...) (MethodJIT.cpp:1064)
    by 0x8BA780D: js::mjit::JaegerShot(...) (MethodJIT.cpp:1125)
    by 0x8A82DA8: js::Interpret(...) (jsinterp.cpp:3987)

We need memory reporter(s) for the input/output streams.  Bug 699801 will stay open to investigate which add-on is causing the memory usage.

Something that might be pertinent:  the JS memory reporters currently measure the chars in all JSStrings with the exception of external strings.  (The reason for this is that the JS memory reporter doesn't know if the chars are measured by a different reporter.)  So if any of this stuff is going into external JSStrings, it won't be measured.
Whiteboard: [MemShrink] → [MemShrink:P2]
The unreported memory here is from an out param [1], there's nothing to measure in `nsBinaryInputStream` itself. I'm going to close this but feel free to reopen if I'm missing something.

[1] http://searchfox.org/mozilla-central/rev/e62604a97286f49993eb29c493672c17c7398da9/xpcom/io/nsBinaryStream.cpp#802
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.