Malloc错误“无法分配区域";失败,错误代码为12.您知道如何解决此问题吗? [英] Malloc error "can't allocate region" failed with error code 12. Any idea how to resolve this?
问题描述
我遇到此错误,不知道该怎么办:
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.
有人可以给我帮助吗?
brush51
Can someone give me help?
brush51
更多信息:
-我正在模拟器中尝试此操作,而不是在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];
推荐答案
Google搜集了很多有关使用仪器来了解内存状况的教程:
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=相关
And another:
Finding Obj-C memory leaks (video)
http://www.youtube.com/watch?v=R449qEuexNs&feature=related
*关于stackoverflow您有很多类似的问题可能会受益.
*There are many similar questions on stackoverflow you might benefit from.
这篇关于Malloc错误“无法分配区域";失败,错误代码为12.您知道如何解决此问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!