Malloc错误“无法分配区域"失败,错误代码 12.知道如何解决这个问题吗? [英] Malloc error "can't allocate region" failed with error code 12. Any idea how to resolve this?

查看:29
本文介绍了Malloc错误“无法分配区域"失败,错误代码 12.知道如何解决这个问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误,不知道该怎么办:

i am getting this error and dont know what to do with that:

AppName(3786,0xa0810540) malloc: *** mmap(size=16777216) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

如果我在发生错误的那一行设置了一个断点,我不知道我必须专门搜索什么.在工具中,我检查了分配,并且该值正在增加,直到所有分配的 14,5 GB.

If i set a breakpoint to that line that occurs the error, i dont know what i have to search specially for. In instruments i have checked the allocations and the value is increasing until 14,5 GB of all allocations.

有人可以帮我吗?
刷51

Can someone give me help?
brush51

编辑 1:
更多信息:
- 我正在模拟器中尝试这个,而不是在 iOS 设备上.
- 这就是所有输出(我多次收到此错误).- 错误发生在这一行:

EDIT 1:
More informations:
- I am trying this in the simulator, not on the iOS device.
- Thats all of the output(i am getting this error more times). - the error occurs on this line:

NSManagedObjectContext *context = [self managedObjectContext];
NSFetchRequest *fetchREntitySetsCards = [[[NSFetchRequest alloc] init] autorelease];
//NSFetchRequest *fetchREntityRelCardsAnswersNotes = [[[NSFetchRequest alloc] init] autorelease];

NSEntityDescription *entitySetsCards = [NSEntityDescription entityForName:@"EntitySetsCards" inManagedObjectContext:context];
//NSEntityDescription *entityRelCardsAnswersNotes = [NSEntityDescription entityForName:@"EntityRelCardsAnswersNotes" inManagedObjectContext:context];
setEntity:entityCard];
[fetchREntitySetsCards setEntity:entitySetsCards];
//[fetchREntityRelCardsAnswersNotes setEntity:entityRelCardsAnswersNotes];

NSArray *fetchedObjSetsCards    = [context executeFetchRequest:fetchREntitySetsCards error:&error];
//The error is here--->
//NSArray *fetchedObjRelCardsAnswersNotes   = [context executeFetchRequest:fetchREntityRelCardsAnswersNotes error:&error];


//Badges für TabBarItem Inbox setzen
setsCount = [context countForFetchRequest:fetchREntityUserSet error: &error];
cardsCount = [context countForFetchRequest:fetchREntityCard error: &error];

推荐答案

谷歌搜索会发现很多关于使用工具来理解你的记忆发生了什么的教程:

Googling will reveal quite a few tutorials on using instruments to understand what is going on with your memory:

如何调试内存泄漏:(教程)
http://www.raywenderlich.com/2696/how-to-debug-memory-leaks-with-xcode-and-instruments-tutorial

还有一个:
查找 Obj-C 内存泄漏(视频)
http://www.youtube.com/watch?v=R449qEuexNs&feature=相关

*stackoverflow 上有很多类似的问题你可能会从中受益.

*There are many similar questions on stackoverflow you might benefit from.

这篇关于Malloc错误“无法分配区域"失败,错误代码 12.知道如何解决这个问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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