cordova:WebCore上iOS上的间歇性内存不足情况?

时间:2016-03-07 19:45:35

标签: cordova memory-leaks

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

详细说明:

Mac mini
OSX Yosemite 10.10.5
Xcode 7.2.1
Cordova 6.0.0

一个页面(用于编码音频文件),有时操作得很好,而在其他时候,永远不会在该页面的javascript(“js / audio_files.js”)中尽早到达设置的xcode断点,并且抛出内存异常(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:在线程“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 ()

此页面的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>

0 个答案:

没有答案