Closed Bug 820894 Opened 12 years ago Closed 12 years ago

Memory from compiled worker scripts is un-reported

Categories

(Core :: JavaScript Engine, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 813867

People

(Reporter: justin.lebar+bug, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [MemShrink])

The DMD report in attachment 691386 [details] shows the following set of unreported blocks in the main process with the B2G gallery app open and in the foreground.

> Unreported: 4 blocks in block group 4 of 724
>  643,072 bytes (637,896 requested / 5,176 slop)
>  2.34% of the heap (13.67% cumulative);  4.78% of unreported (27.98% cumulative)
>  Allocated at
>    replace_realloc /Users/jlebar/code/moz/ff-git/src/memory/replace/dmd/DMD.cpp:982 (0x400c3e2c libdmd.so+0x2e2c)
>    realloc /Users/jlebar/code/moz/ff-git/src/memory/build/replace_malloc.c:192 (0x4024e218 libmozglue.so+0x4218)
>    js_realloc /Users/jlebar/code/moz/B2G/objdir-gecko/dist/include/js/Utility.h:160 (0x41c2fa3e libxul.so+0xd1ba3e)
>    js::frontend::CompileScript(JSContext*, JS::Handle<JSObject*>, js::StackFrame*, JS::CompileOptions const&, JS::StableCharPtr, unsigned int, JSString*, unsigned int) /Users/jlebar/code/moz/ff-git/src/js/src/frontend/BytecodeCompiler.cpp:88 (0x41c8d3b2 libxul.so+0xd793b2)
>    Rooted /Users/jlebar/code/moz/ff-git/src/js/src/gc/Root.h:658 (0x41b7da52 libxul.so+0xc69a52)
>    (anonymous namespace)::ScriptExecutorRunnable::WorkerRun(JSContext*, mozilla::dom::workers::WorkerPrivate*) /Users/jlebar/code/moz/ff-git/src/dom/workers/ScriptLoader.cpp:630 (0x41545238 libxul.so+0x631238)
>    mozilla::dom::workers::WorkerRunnable::Run() /Users/jlebar/code/moz/ff-git/src/dom/workers/WorkerPrivate.cpp:1806 (0x415480bc libxul.so+0x6340bc)
>    mozilla::dom::workers::WorkerPrivate::RunSyncLoop(JSContext*, unsigned int) /Users/jlebar/code/moz/ff-git/src/dom/workers/WorkerPrivate.cpp:3380 (0x4154926e libxul.so+0x63526e)
>    (anonymous namespace)::LoadAllScripts(JSContext*, mozilla::dom::workers::WorkerPrivate*, nsTArray<(anonymous namespace)::ScriptLoadInfo, nsTArrayDefaultAllocator>&, bool) /Users/jlebar/code/moz/ff-git/src/dom/workers/ScriptLoader.cpp:688 (0x41545ac8 libxul.so+0x631ac8)
>    Clear /Users/jlebar/code/moz/B2G/objdir-gecko/dist/include/nsTArray.h:956 (0x41545c90 libxul.so+0x631c90)
>    (anonymous namespace)::CompileScriptRunnable::WorkerRun(JSContext*, mozilla::dom::workers::WorkerPrivate*) /Users/jlebar/code/moz/ff-git/src/dom/workers/WorkerPrivate.cpp:704 (0x41548028 libxul.so+0x634028)
>    mozilla::dom::workers::WorkerRunnable::Run() /Users/jlebar/code/moz/ff-git/src/dom/workers/WorkerPrivate.cpp:1806 (0x415480bc libxul.so+0x6340bc)
>    mozilla::dom::workers::WorkerPrivate::DoRunLoop(JSContext*) /Users/jlebar/code/moz/ff-git/src/dom/workers/WorkerPrivate.cpp:2790 (0x4154ab9c libxul.so+0x636b9c)
>    ~JSAutoRequest /Users/jlebar/code/moz/B2G/objdir-gecko/dist/include/jsapi.h:2922 (0x41543fac libxul.so+0x62ffac)
>    nsThread::ProcessNextEvent(bool, bool*) /Users/jlebar/code/moz/ff-git/src/xpcom/threads/nsThread.cpp:627 (0x419679de libxul.so+0xa539de)
>    NS_ProcessNextEvent_P(nsIThread*, bool) /Users/jlebar/code/moz/B2G/objdir-gecko/dist/include/nsError.h:156 (0x41947c2a libxul.so+0xa33c2a)
>    nsThread::ThreadFunc(void*) /Users/jlebar/code/moz/ff-git/src/xpcom/threads/nsThread.h:63 (0x41967e28 libxul.so+0xa53e28)
>    _pt_root /Users/jlebar/code/moz/ff-git/src/nsprpub/pr/src/pthreads/ptthread.c:159 (0x40180a70 libnspr4.so+0x19a70)
>    __thread_entry /Users/jlebar/code/moz/B2G/bionic/libc/bionic/pthread.c:218 (0x400cde18 libc.so+0x12e18)
>    pthread_create /Users/jlebar/code/moz/B2G/bionic/libc/bionic/pthread.c:362 (0x400cd96c libc.so+0x1296c)
Also

> Unreported: 4 blocks in block group 15 of 724
>  131,072 bytes (118,888 requested / 12,184 slop)
>  0.48% of the heap (24.27% cumulative);  0.97% of unreported (49.66% cumulative)
>  Allocated at
>    replace_realloc /Users/jlebar/code/moz/ff-git/src/memory/replace/dmd/DMD.cpp:982 (0x400c3e2c libdmd.so+0x2e2c)
>    realloc /Users/jlebar/code/moz/ff-git/src/memory/build/replace_malloc.c:192 (0x4024e218 libmozglue.so+0x4218)
>    js_realloc /Users/jlebar/code/moz/B2G/objdir-gecko/dist/include/js/Utility.h:160 (0x41c2fa3e libxul.so+0xd1ba3e)
>    js::frontend::CompileScript(JSContext*, JS::Handle<JSObject*>, js::StackFrame*, JS::CompileOptions const&, JS::StableCharPtr, unsigned int, JSString*, unsigned int) /Users/jlebar/code/moz/ff-git/src/js/src/frontend/BytecodeCompiler.cpp:88 (0x41c8d3b2 libxul.so+0xd793b2)
>    Rooted /Users/jlebar/code/moz/ff-git/src/js/src/gc/Root.h:658 (0x41b7da52 libxul.so+0xc69a52)
>    (anonymous namespace)::ScriptExecutorRunnable::WorkerRun(JSContext*, mozilla::dom::workers::WorkerPrivate*) /Users/jlebar/code/moz/ff-git/src/dom/workers/ScriptLoader.cpp:630 (0x41545238 libxul.so+0x631238)
>    mozilla::dom::workers::WorkerRunnable::Run() /Users/jlebar/code/moz/ff-git/src/dom/workers/WorkerPrivate.cpp:1806 (0x415480bc libxul.so+0x6340bc)
>    mozilla::dom::workers::WorkerPrivate::RunSyncLoop(JSContext*, unsigned int) /Users/jlebar/code/moz/ff-git/src/dom/workers/WorkerPrivate.cpp:3380 (0x4154926e libxul.so+0x63526e)
>    (anonymous namespace)::LoadAllScripts(JSContext*, mozilla::dom::workers::WorkerPrivate*, nsTArray<(anonymous namespace)::ScriptLoadInfo, nsTArrayDefaultAllocator>&, bool) /Users/jlebar/code/moz/ff-git/src/dom/workers/ScriptLoader.cpp:688 (0x41545ac8 libxul.so+0x631ac8)
>    mozilla::dom::workers::scriptloader::Load(JSContext*, unsigned int, JS::Value*) /Users/jlebar/code/moz/ff-git/src/dom/workers/ScriptLoader.cpp:745 (0x41545c0c libxul.so+0x631c0c)
>    (anonymous namespace)::WorkerGlobalScope::ImportScripts(JSContext*, unsigned int, JS::Value*) /Users/jlebar/code/moz/ff-git/src/dom/workers/WorkerScope.cpp:432 (0x4154b9b2 libxul.so+0x6379b2)
>    CallJSNative /Users/jlebar/code/moz/ff-git/src/js/src/jscntxtinlines.h:364 (0x41bdc9f2 libxul.so+0xcc89f2)
>    js::Interpret(JSContext*, js::StackFrame*, js::InterpMode) /Users/jlebar/code/moz/ff-git/src/js/src/jsinterp.cpp:2341 (0x41bd99ae libxul.so+0xcc59ae)
>    js::RunScript(JSContext*, JS::Handle<JSScript*>, js::StackFrame*) /Users/jlebar/code/moz/ff-git/src/js/src/jsinterp.cpp:346 (0x41bdc236 libxul.so+0xcc8236)
>    ExecuteKernel /Users/jlebar/code/moz/ff-git/src/js/src/jsinterp.cpp:535 (0x41bdd0e2 libxul.so+0xcc90e2)
>    ~AutoLastFrameCheck /Users/jlebar/code/moz/ff-git/src/js/src/jscntxt.h:1636 (0x41b7da62 libxul.so+0xc69a62)
>    (anonymous namespace)::ScriptExecutorRunnable::WorkerRun(JSContext*, mozilla::dom::workers::WorkerPrivate*) /Users/jlebar/code/moz/ff-git/src/dom/workers/ScriptLoader.cpp:630 (0x41545238 libxul.so+0x631238)
>    mozilla::dom::workers::WorkerRunnable::Run() /Users/jlebar/code/moz/ff-git/src/dom/workers/WorkerPrivate.cpp:1806 (0x415480bc libxul.so+0x6340bc)
>    mozilla::dom::workers::WorkerPrivate::RunSyncLoop(JSContext*, unsigned int) /Users/jlebar/code/moz/ff-git/src/dom/workers/WorkerPrivate.cpp:3380 (0x4154926e libxul.so+0x63526e)
>    (anonymous namespace)::LoadAllScripts(JSContext*, mozilla::dom::workers::WorkerPrivate*, nsTArray<(anonymous namespace)::ScriptLoadInfo, nsTArrayDefaultAllocator>&, bool) /Users/jlebar/code/moz/ff-git/src/dom/workers/ScriptLoader.cpp:688 (0x41545ac8 libxul.so+0x631ac8)
>    Clear /Users/jlebar/code/moz/B2G/objdir-gecko/dist/include/nsTArray.h:956 (0x41545c90 libxul.so+0x631c90)
>    (anonymous namespace)::CompileScriptRunnable::WorkerRun(JSContext*, mozilla::dom::workers::WorkerPrivate*) /Users/jlebar/code/moz/ff-git/src/dom/workers/WorkerPrivate.cpp:704 (0x41548028 libxul.so+0x634028)
>    mozilla::dom::workers::WorkerRunnable::Run() /Users/jlebar/code/moz/ff-git/src/dom/workers/WorkerPrivate.cpp:1806 (0x415480bc libxul.so+0x6340bc)
>    mozilla::dom::workers::WorkerPrivate::DoRunLoop(JSContext*) /Users/jlebar/code/moz/ff-git/src/dom/workers/WorkerPrivate.cpp:2790 (0x4154ab9c libxul.so+0x636b9c)
I don't understand how this could be... If the normal functions we call to report runtime memory don't include compiled scripts then we should be seeing similar leaks for the main thread too, right?
(In reply to ben turner [:bent] from comment #2)
> If the normal functions we call to
> report runtime memory don't include compiled scripts then we should be
> seeing similar leaks for the main thread too, right?

Yes, and I don't see those similar leaks.
This could be a dupe of whatever is causing bug 820898.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.