cordova:WebCore中的iOS内存间歇性不足?

cordova:WebCore中的iOS内存间歇性不足?,cordova,memory-leaks,Cordova,Memory Leaks,我有一个cordova应用程序,在android上运行良好,现在在ios上调试。我需要一些帮助来弄清楚如何继续对所描述的内存异常进行调试。谢谢 详情: Mac mini OSX Yosemite 10.10.5 Xcode 7.2.1 Cordova 6.0.0 一个页面(用于对音频文件进行编码)有时运行得很好,而在另一些时候,从未达到该页面javascript中尽早设置的xcode断点(“js/audio_files.js”),并抛出内存异常(bmalloc::VMHead::grow中的E

我有一个cordova应用程序,在android上运行良好,现在在ios上调试。我需要一些帮助来弄清楚如何继续对所描述的内存异常进行调试。谢谢

详情:

Mac mini
OSX Yosemite 10.10.5
Xcode 7.2.1
Cordova 6.0.0
一个页面(用于对音频文件进行编码)有时运行得很好,而在另一些时候,从未达到该页面javascript中尽早设置的xcode断点(“js/audio_files.js”),并抛出内存异常(bmalloc::VMHead::grow中的EXC_BAD_ACCESS),分配了大约1.44GB(是的,GB)内存。异常发生率约为60%

以下数据来自针对iPhone-4s模拟器的xcode调试器。该故障发生在xcode或使用终端/bash中的“cordova run ios--target=“iPhone-4s”时

当异常发生时,页面的元素出现,减去在on_device_ready中建立的图标(从未到达,调用addEventListener的行也未到达)。然后有大约1分钟的暂停,xcode在bmalloc:VMHeap:grow in线程“WebThread”中的问题处停止

“WebThread”的堆栈跟踪如下。我无法提供有关参数值的数据,因为xcode中的lldb控制台不响应任何调试命令,而且我还没有发现如何生成针对ios仿真器的lldb外部实例

#0  0x0b51e966 in bmalloc::VMHeap::grow() ()
#1  0x0b51cca6 in bmalloc::Heap::allocateSmallPage(std::__1::lock_guard<bmalloc::StaticMutex>&, unsigned long) ()
#2  0x0b51cab2 in bmalloc::Heap::refillSmallBumpRangeCache(std::__1::lock_guard<bmalloc::StaticMutex>&, unsigned long, bmalloc::FixedVector<bmalloc::BumpRange, 32ul>&) ()
#3  0x0b51b131 in bmalloc::Allocator::allocateBumpRangeSlowCase(unsigned long) ()
#4  0x0b51b2b7 in bmalloc::Allocator::allocateSlowCase(unsigned long) ()
#5  0x0b4ef9a0 in WTF::fastMalloc(unsigned long) ()
#6  0x097ab757 in WebCore::DOMTimer::install(WebCore::ScriptExecutionContext&, std::__1::unique_ptr<WebCore::ScheduledAction, std::__1::default_delete<WebCore::ScheduledAction> >, int, bool) ()
#7  0x097bab1f in WebCore::DOMWindow::setTimeout(std::__1::unique_ptr<WebCore::ScheduledAction, std::__1::default_delete<WebCore::ScheduledAction> >, int, int&) ()
#8  0x09bba620 in WebCore::JSDOMWindow::setTimeout(JSC::ExecState*) ()
#9  0x09bb5b1e in WebCore::jsDOMWindowPrototypeFunctionSetTimeout(JSC::ExecState*) ()
#10 0x1238463d in 0x1238463d ()
#11 0x123eb1b1 in 0x123eb1b1 ()
#12 0x123e7eb1 in 0x123e7eb1 ()
#13 0x123efdbb in 0x123efdbb ()
#14 0x0b361934 in llint_entry ()
#15 0x0b35d477 in vmEntryToJavaScript ()
#16 0x0b2247dc in JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) ()
#17 0x0b209ca9 in JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#18 0x0afacfa1 in JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&) ()
#19 0x0a1674b1 in WebCore::ScheduledAction::executeFunctionInContext(JSC::JSGlobalObject*, JSC::JSValue, WebCore::ScriptExecutionContext&) ()
#20 0x0a16703b in WebCore::ScheduledAction::execute(WebCore::Document&) ()
#21 0x0a166f49 in WebCore::ScheduledAction::execute(WebCore::ScriptExecutionContext&) ()
#22 0x097ac03c in WebCore::DOMTimer::fired() ()
#23 0x0a356a30 in WebCore::ThreadTimers::sharedTimerFiredInternal() ()
#24 0x0a3568c6 in WebCore::ThreadTimers::sharedTimerFired() ()
#25 0x0a1c242f in WebCore::timerFired(__CFRunLoopTimer*, void*) ()
#26 0x00d94f56 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ ()
#27 0x00d94952 in __CFRunLoopDoTimer ()
#28 0x00d52c3a in __CFRunLoopRun ()
#29 0x00d520e6 in CFRunLoopRunSpecific ()
#30 0x00d51efb in CFRunLoopRunInMode ()
#31 0x0a3d72f0 in RunWebThread(void*) ()
#32 0x039b9c25 in _pthread_body ()
#33 0x039b9b9b in _pthread_start ()
#34 0x039b6e32 in thread_start ()
bmalloc::VMHeap::grow()中的0 0x0b51e966 #bmalloc::Heap::allocateSmallPage中的1 0x0b51cca6(std:_1::lock\u guard&,无符号长)() #bmalloc::Heap::refillSmallBumpRangeCache(std:_u1::lock\u guard&,unsigned long,bmalloc::FixedVector&)中的2 0x0b51cab2() #bmalloc::分配器::allocateBumpRangeSlowCase中的3 0x0b51b131(无符号长)() #bmalloc::Allocator::allocateSlowCase(无符号长)()中的4 0x0b51b2b7 #WTF中的5 0x0b4ef9a0::fastMalloc(无符号长)() #WebCore::DOMTimer::install(WebCore::ScriptExecutionContext&,std::_1::unique_ptr,int,bool)中的6 0x097ab757() #WebCore::DOMWindow::setTimeout中的7 0x097bab1f(标准:_1::unique_ptr,int,int&)() #WebCore::JSDOMWindow::setTimeout(JSC::ExecState*)中的8 0x09bba620() #WebCore::jsDOMWindowPrototypeFunctionSetTimeout(JSC::ExecState*)中的9 0x09bb5b1e() #0x1238463d中的10 0x1238463d() #0x123eb1b1中的11 0x123eb1b1() #0x123e7eb1中的12 0x123e7eb1() #0x123efdbb()中的13 0x123efdbb #llint_条目中的14 0x0b361934() #vmEntryToJavaScript()中的15 0x0b35d477 #JSC::JITCode::execute(JSC::VM*,JSC::ProtoCallFrame*)中的16 0x0b2247dc() #JSC::解释器::executeCall中的17 0x0b209ca9(JSC::ExecState*,JSC::JSObject*,JSC::CallType,JSC::CallData const&,JSC::JSC::ArgList const&)() #JSC::call(JSC::ExecState*,JSC::JSValue,JSC::CallType,JSC::CallData常量&,JSC::JSValue,JSC::ArgList常量&,WTF::NakedPtr&)中的18 0x0afacfa1() #19 WebCore::ScheduledAction::executeFunctionInContext(JSC::JSGlobalObject*,JSC::JSValue,WebCore::ScriptExecutionContext&)中的0x0a1674b1() #WebCore::ScheduledAction::execute(WebCore::Document&)中的20 0x0a16703b #WebCore::ScheduledAction::execute中的21 0x0a166f49(WebCore::ScriptExecutionContext&)() #WebCore::DOMTimer::fired()中的22 0x097ac03c() #WebCore::ThreadTimers::sharedTimerFiredInternal()中的23 0x0a356a30() #WebCore::ThreadTimers::sharedTimerFired()中的24 0x0a3568c6() #WebCore中的25 0x0a1c242f::timerFired(uu CFRunLoopTimer*,void*)() #26 0x00d94f56 in uuu CFRUNLOOP正在调用一个计时器回调函数 #27 0x00d94952英寸\uuu CFRunLoopDoTimer() #28 0x00d52c3a在\uuuu CFRunLoopRun()中 #CFRunLoopRunSpecific()中的29 0x00d520e6 #CFRunLoopRunInMode()中的30 0x00d51efb #RunWebThread中的31 0x0a3d72f0(无效*)() #螺纹体()中的32 0x039b9c25 #线程启动()中的33 0x039b9b9b #34 0x039b6e32在线程\u开始() 此页面的html:

<!DOCTYPE html>
<html>
<head></head>
<body>

<script id="audio-tpl" type="text/template">
    <p id="{{title_id}}" class="title"></p>

    <div id='{{player_id}}' class='contents'>
        <div id='{{file_name}}' class='player_state'/>
        <div id='{{player_state}}' class='player_state'/>
        <button id='{{record_start_id}}' class='{{plr_ctl_class}}' hidden></button>
        <button id='{{record_stop_id}}' class='{{plr_ctl_class}}' hidden></button>
        <button id='{{play_start_id}}' class='{{plr_ctl_class}}' hidden></button>
        <button id='{{play_pause_id}}' class='{{plr_ctl_class}}' hidden></button>
        <button id='{{play_stop_id}}' class='{{plr_ctl_class}}' hidden></button>
        <button id='{{play_rewind_id}}' class='{{plr_ctl_class}}' hidden></button>
        <button id='{{eject_id}}' class='{{plr_ctl_class}}' hidden></button>
        <br/>
        <button id='{{upload_id}}' class='{{button_class}}'>Upload</button>
        <br/>

        <div id='{{error_id}}' class='error'/>
        <div id='{{file_list_div_id}}'/>
        <div id='{{log_id}}'/>
    </div>

</script>

<script src="cordova.js"></script>
<script src="js_lib/fastclick.js"></script>
<script src="js_lib/handlebars.js"></script>
<script src="js_lib/jquery.js"></script>
<script src="js/title.js"></script>
<script src="js/html_utils.js"></script>
<script src="js/audio_files.js"></script>

</body>
</html>


上传