2011-05-11 117 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