2011-05-11 129 views
1

我正在开发一个自定义摄像头控件的小应用程序。purgeMemoryForReason摄像头控制UIImagePickerViewController

与所有的功能在内存

工作柠良好,没有任何泄漏,但当我尝试访问摄像头超过8-9倍,应用程序崩溃...

我与性能工具的检查,但有是没有内存泄漏有,,, 还住总叮咬4.96 MB仅

我收到以下错误......



Thread 0 name: Dispatch queue: com.apple.main-thread 
Thread 0 Crashed: 
0 libsystem_kernel.dylib   0x35443a1c __pthread_kill + 8 
1 libsystem_c.dylib    0x320e93b4 pthread_kill + 52 
2 libsystem_c.dylib    0x320e1bf8 abort + 72 
3 libstdc++.6.dylib    0x31d5ca64 __gnu_cxx::__verbose_terminate_handler() + 376 
4 libobjc.A.dylib     0x3011006c _objc_terminate + 104 
5 libstdc++.6.dylib    0x31d5ae36 __cxxabiv1::__terminate(void (*)()) + 46 
6 libstdc++.6.dylib    0x31d5ae8a std::terminate() + 10 
7 libstdc++.6.dylib    0x31d5af5a __cxa_throw + 78 
8 libobjc.A.dylib     0x3010ec84 objc_exception_throw + 64 
9 CoreFoundation     0x3170e1b8 -[NSObject(NSObject) doesNotRecognizeSelector:] + 96 
10 CoreFoundation     0x3170d642 ___forwarding___ + 502 
11 CoreFoundation     0x31684178 _CF_forwarding_prep_0 + 40 
12 UIKit       0x32a37118 -[UIViewController purgeMemoryForReason:] + 20 
13 UIKit       0x32a37146 -[UIViewController didReceiveMemoryWarning] + 10 
14 UIKit       0x32a3715c -[UIViewController _didReceiveMemoryWarning:] + 8 
15 Foundation      0x3632117c _nsnote_callback + 136 
16 CoreFoundation     0x316d9208 __CFXNotificationPost_old + 396 
17 CoreFoundation     0x31673ee4 _CFXNotificationPostNotification + 112 
18 Foundation      0x3631e5cc -[NSNotificationCenter postNotificationName:object:userInfo:] + 64 
19 Foundation      0x363201ba -[NSNotificationCenter postNotificationName:object:] + 18 
20 UIKit       0x32a0d35a -[UIApplication _performMemoryWarning] + 42 
21 UIKit       0x32a0dd7c -[UIApplication _receivedMemoryNotification] + 120 
22 UIKit       0x32a0b500 _memoryStatusChanged + 36 
23 CoreFoundation     0x316d9d62 __CFNotificationCenterDarwinCallBack + 18 
24 CoreFoundation     0x316d6bd8 __CFMachPortPerform + 204 
25 CoreFoundation     0x316e1a90 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20 
26 CoreFoundation     0x316e3838 __CFRunLoopDoSource1 + 160 
27 CoreFoundation     0x316e4606 __CFRunLoopRun + 514 
28 CoreFoundation     0x31674ebc CFRunLoopRunSpecific + 224 
29 CoreFoundation     0x31674dc4 CFRunLoopRunInMode + 52 
30 GraphicsServices    0x36497418 GSEventRunModal + 108 
31 GraphicsServices    0x364974c4 GSEventRun + 56 
32 UIKit       0x328e2d62 -[UIApplication _run] + 398 
33 UIKit       0x328e0800 UIApplicationMain + 664 
34 Imagepicker     0x000020ec main (main.m:14) 
35 Imagepicker     0x000020a0 start + 32 




个直播叮咬少于5 MB还是我得到这个崩溃... 3G和3GS,它变得更加有线... 它崩溃这么多,他们...多的时候......

任何帮助?????

+0

请检查最大的分配,(除了现场字节)。还要检查您是否在打开相机视图并关闭它时恢复完成分配,分配是否添加? – Ravin 2011-05-12 04:08:56

+0

嗨Ravin ...感谢您的回复...我检查“总体字节”和“实时字节”....实时字节确实减少,因为我释放它..但总体字节确实增加...但我相信整体字节是总分配,但实时字节是应用程序的真正字节... – 2011-05-13 16:04:02

回答

0

我有一个类似的问题,我已经建立了一个相机应用程序。我收到很多低内存警告。你在看那些吗?

作为一种权宜之计,而我确定我已经把这样的问题:

 
- (void)didReceiveMemoryWarning { 
    NSLog(@"memory problem!!!!!!!!!!"); 
    NSString *errorString = [NSString stringWithFormat:@"There isn't enough memory to run this app right now. You should quit some apps and try again."]; 
    UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:@"Low Memory Warning" message:errorString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
    [errorAlert show]; 
    [errorAlert release];  
    [super didReceiveMemoryWarning]; 
} 
+0

嗨马克!感谢您的回复 !!我以前认为相同的方式..但许多其他应用程序与相机可以运行在这一点..我的意思是其他应用程序,如Photobooth和所有有摄像头控制也......他们可以在同一点运行..为什么我有这个问题!所以我觉得我在这里做错了什么!你有没有找到其他解决方案? – 2011-05-13 22:58:04

+0

在未来的某个时候,我会通过我的应用程序尝试减少内存使用 - 如果我找到任何相机特定的内容,我会在这里发布。 – 2011-05-16 18:08:20

+0

任何帮助?我仍然卡住:( – 2011-05-24 17:19:31