Closed Bug 610073 Opened 15 years ago Closed 8 years ago

XPCJSStackFrame::CreateStack allocates heap that is never read

Categories

(Core :: XPConnect, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INACTIVE

People

(Reporter: jseward, Unassigned)

Details

For a run of M-C of 29 Oct, x86_64-Linux, flashblock as the only extension. Startup with 5 tabs with fairly complex pages, a bit of browsing, the heap maxes out at 72,395,085 bytes in 411,549 blocks. When ranking heap allocation stacks by maximum liveness, XPCJSStackFrame::CreateStack comes 8th, with 1,685,141 bytes in 19,649 blocks live (2.3% of the total heap volume). Of these blocks, literally not a single byte of them is ever read, so the entire allocation is (at least on this path of execution) useless. <bz> so here's the deal <bz> every time we throw an xpconnect exception <bz> we make this clone of the js stack <bz> and stick it in the location object <bz> someone _could_ query it <bz> but usually does not, of course <bz> and the stack stays alive as long as the exception object does <bz> which depends on things like gc and what other things are firing and how long the console service keeps it alive for and whatnot So it may be unavoidable. But recording it anyway. raw data: ======== SUMMARY STATISTICS ======== guest_insns: 75,213,429,144 max_live: 72,395,085 in 411,549 blocks tot_alloc: 2,035,850,111 in 6,282,282 blocks insns per allocated byte: 36 [...] -------------------- 8 of 5000 -------------------- max-live: 1,685,141 in 19,649 blocks tot-alloc: 2,377,680 in 27,786 blocks (avg size 85.57) deaths: 27,786, at avg age 428,816,454 (0.57% of prog lifetime) acc-ratios: 0.00 rd, 1.00 wr (0 b-read, 2,377,680 b-written) at 0x4C275B8: malloc (/home/sewardj/VgTRUNK/trunk/ coregrind/m_replacemalloc/vg_replace_malloc.c:236) by 0x63F25F4: NS_Alloc_P (xpcom/base/nsMemoryImpl.cpp:210) by 0x63A3580: nsMemory::Clone(void const*, unsigned long) (ff-opt/xpcom/build/nsMemory.cpp:61) by 0x5EC44DA: XPCJSStackFrame::CreateStack(JSContext*, JSStackFrame*, XPCJSStackFrame**) (js/src/xpconnect/src/xpcstack.cpp:168) by 0x5EC4435: XPCJSStackFrame::CreateStack(JSContext*, JSStackFrame*, XPCJSStackFrame**) (js/src/xpconnect/src/xpcstack.cpp:146)
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.