相机控制 UIImagePickerViewController 的 purgeMemoryForReason

发布于 2024-11-07 07:29:33 字数 3243 浏览 0 评论 0原文

我正在开发一个带有自定义相机控件的小型应用程序。

它的所有功能都工作得很好,没有任何内存泄漏

,但是当我尝试访问相机超过 8-9 次时,应用程序崩溃......

我用性能​​工具检查过,但那里没有内存泄漏,,, 另外,Live Bites 总大小为 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




Live Bites 小于 5 MB,但我仍然遇到此崩溃... 对于 3G 和 3G,它变得更加有线...... 它对他们来说太崩溃了……而且更常见的是……

有什么帮助吗???

I am developing a small application with Custom Camera control .

Its working verry well with all functionality without any Leak in Memory

But when i try to access camera more than 8-9 times, application crash ...

I checked with Performance tool but there is no memory leak there ,,,
also total Live Bites is 4.96 MB only

I am getting following error ...



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




Live bites are less than 5 MB still i am getting this crash ...
For 3G and 3Gs , it became more wired ...
It crash so much for them ... and more often ...

Any help ?????

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赴月观长安 2024-11-14 07:29:33

我构建的相机应用程序也遇到类似的问题。我收到很多内存不足的警告。你在看那些吗?

作为权宜之计,当我确定问题时,我放入了如下内容:

- (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];
}

I am having a similar problem with a camera app that I have built. I am getting lots of low memory warnings. Are you watching those?

As a stopgap measure while I determine the problem I have put in something like this:

- (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];
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文