(仅限XCode 7 + iOS 9 + iPhone 4s/iPhone5)问题:& quot; malloc:*** mach_vm_map(size = 1048576)失败(错误代码= 3)& quot; [英] (XCode 7 + iOS 9 + iPhone 4s/iPhone5 only) issue: "malloc: *** mach_vm_map(size=1048576) failed (error code=3)"

查看:74
本文介绍了(仅限XCode 7 + iOS 9 + iPhone 4s/iPhone5)问题:& quot; malloc:*** mach_vm_map(size = 1048576)失败(错误代码= 3)& quot;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题与内存分配有关,但是我只能在iOS 9,XCode 7中得到它.在XCode 6.4,iOS 8.4中,它工作得非常完美,根本没有任何问题.在iOS 9中,XCode 7经常崩溃,并给出此错误.

I know the issue is related to memory allocations, but I get it in only iOS 9, XCode 7. In XCode 6.4, iOS 8.4, it works just perfect, no issue at all at any ways. In iOS 9, XCode 7, it just crashes very frequently giving this error.

malloc: *** mach_vm_map(size=1048576) failed (error code=3) *** error: can't allocate region securely *** set a breakpoint in malloc_error_break to debug

malloc: *** mach_vm_map(size=1048576) failed (error code=3) *** error: can't allocate region securely *** set a breakpoint in malloc_error_break to debug

有什么建议吗?我正在处理内存问题,但是我想知道是否有太多内存问题,那为什么它在iOS 8.4而不是iOS 9中能正常工作?

Any suggestions? I am working on memory issues, but I wonder if there were too many memory issues, then why did it work in iOS 8.4 and not in iOS 9?

此外,我的所有UI都变白了!就像导航栏没有标题一样,自定义选项卡(RDVTabBar)不可见,但是,其他视图控制器在那里(它会响应触摸事件,您可以点击该区域,该区域中的按钮起作用!).

Also, I get all my UI whited out! Like navigation bar has no title, custom tabbar(RDVTabBar) is not visible, however, other view controller is there (it responds to the touch events, you can tap that area and the button positioned in that area acts!).

P.S.我从没有收到内存警告,也没有调用applicationWillTerminate:方法!

P.S. I don't get memory warning ever, neither applicationWillTerminate: method is being called!

更新:我发现此问题仅发生在iPhone 5和4s中! (非64位设备!)

Update: I found that this issue occurs in iPhone 5 and 4s only! (Non-64bit devices!)

更新2:当发生崩溃时,我尝试打印其中一个对象并进行打印,在调试模式下,我再次遇到相同的错误: malloc: *** mach_vm_map(size=1048576) failed (error code=3) *** error: can't allocate region securely *** set a breakpoint in malloc_error_break to debug.

Update 2: When the crash happens, I try to print one of the object and to print it, I again get the same error in debug mode: malloc: *** mach_vm_map(size=1048576) failed (error code=3) *** error: can't allocate region securely *** set a breakpoint in malloc_error_break to debug.

------------------更新------------------

------------------ Update ------------------

好吧,我在这里找到了一些东西:我在Instruments中检查了我的应用程序,检测到它在iOS 8.4中占用约200mb的内存,令人惊讶的是iOS 9. *占用了1.5 GB的内存!!!这是我不明白的东西!一个应用程序在iOS 8.4中占用200 mb的内存,而同一应用程序在iOS 9中占用超过1.5GB的内存!根本无法理解!有想法吗?

Well, I found something here: I inspected my app in Instruments and detected that it occupies about 200mb of memory in iOS 8.4, and surprisingly iOS 9.* occupies 1.5 GB of the memory!!! This is something I don't understand! One app takes 200 mb of memory in iOS 8.4 and the same app takes over 1.5GB of memory on iOS 9! Not understandable at all! Any Idea?

推荐答案

好吧,我想我终于找到了问题所在:绝对是内存问题,但是我必须在哪里搜索.我发现我使用了两个第三方标签: CXAHyperlinkLabel STTweetLabel .当我删除它们时,我的应用程序运行正常!该问题已解决,但我仍然感到困惑,为什么它在iOS 8.4上确实可以正常工作(并且仍然可以正常工作),并且在iOS 9.0及更高版本中占用了超过1.5 GB的内存!如果它在内存方面存在一些问题(我发现了一些问题,并且仍在修复中),为什么它可以在iOS 8. *上运行. 因此,对于任何遇到此类问题的人,我的建议是,我建议使用UITextView进行链接(我做到了,并且很好地替代了它.)

Well, I guess I have finally found the issue: Its definitely memory issue, but I had to search where. I found that I am using two third party labels namely: CXAHyperlinkLabel and STTweetLabel. When I removed those, my app just work fine!! The issue has been resolved but still I am confused why it did work (and still works) great in iOS 8.4 and eats up more than 1.5 GB of memory in iOS 9.0 and above!! If it has some issues with memory (I found some and fixed already, still), why it did work with iOS 8.*. So, my advice to any fellow who are having such issues, I recommend using UITextView for links (I did it and its nice replacement).

这篇关于(仅限XCode 7 + iOS 9 + iPhone 4s/iPhone5)问题:& quot; malloc:*** mach_vm_map(size = 1048576)失败(错误代码= 3)& quot;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆