Detect and diagnose memory issues

RSS for tag

Discuss the WWDC21 session Detect and diagnose memory issues.

Posts under wwdc21-10180 tag

12 Posts

Post

Replies

Boosts

Views

Activity

PHPickerViewController causes memory link
I want to pick an image with PHPickerViewController. But this causes to memory link. Can anyone help me with this issue?( I created ImagePickerManager and I'm using it on ViewController below. P.s: I didn't get a leak when writing the same code with UIImagePickerViewController. import Foundation import Photos import PhotosUI class ImagePickerManager: NSObject {   // MARK: Variables   var accessType: PHAccessLevel = .addOnly   var pickerViewController = PHPickerViewController(configuration: PHPickerConfiguration())   //var viewController: UIViewController?   var pickImageCallback : ((UIImage) -> ())?;   // MARK: Init   override init() {     super.init()     setupPhotoPicker()     setupPhotoLibrary(accessType)   } //  convenience init( //    viewController: UIViewController, //    accessType: PHAccessLevel = .addOnly) { //      self.init() // //      self.viewController = viewController //      setupPhotoLibrary(accessType) //      setupPhotoPicker() //    }   // MARK: Setup   private func setupPhotoLibrary(_ accessType: PHAccessLevel) {     self.checkAuthorizationStatusForPhotoLibrary()     self.accessType = accessType   }   private func setupPhotoPicker() {     pickerViewController.delegate = self   }   // MARK: Present PickerController   func presentPHPicker(_ viewContr: UIViewController,_ callback: @escaping ((UIImage) -> ())) {     pickImageCallback = callback    // self.viewController = viewContr     viewContr.present(pickerViewController, animated: true)   }   // MARK: Checking status of Photo library access   func checkAuthorizationStatusForPhotoLibrary() {     switch PHPhotoLibrary.authorizationStatus(for: accessType) {     case .authorized: break     case .notDetermined:       self.requestAuthorizationForPhotoLibrary()     case .denied:       self.showAccessDeniedMessage()     default: return     }   }   // MARK: Request to Access Photo Library   func requestAuthorizationForPhotoLibrary () {     PHPhotoLibrary.requestAuthorization(for: accessType) { status in       switch status {       case .authorized:         print("Access granted")       case .denied: break       case .notDetermined: break       default: return       }     }   }   // MARK: Access Denied to do action   private func showAccessDeniedMessage() {     print("\n ShowAccessDeniedMessage \n")   } } // MARK: - PHPickerViewControllerDelegate extension ImagePickerManager: PHPickerViewControllerDelegate, UINavigationControllerDelegate {   func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {     picker.dismiss(animated: true, completion: nil)     for result in results {       result.itemProvider.loadObject(ofClass: UIImage.self, completionHandler: { (object, error) in         if let image = object as? UIImage { //          DispatchQueue.main.async {             // Use UIImage             self.pickImageCallback?(image) //          }         }       })     }   } } /// -------- ViewController let imageManager = ImagePickerManager()   @objc func pressedButton() {     imageManager.presentPHPicker(self) { image in       print("something...")     }   }
2
0
1.7k
Apr ’22
boringssl_metrics_log_metric_block_invoke(151) Failed to log metrics
Just Created one Login screen and its UI, UI is custom reads all properties from the local JSON file, like color, button shape, background color, icon URL, etc. Used one Framework which I have created for my UI, and just drag and drop that framework (No API calls in that Framework) but when I run my project my UI gets stuck, Not able to click any button or text field. and I am getting the following error boringssl_metrics_log_metric_block_invoke(151) Failed to log metrics  also, My CPU use is 100% and my app is getting stuck (see screenshot) Memory is increasing to 6 to 7 GB. but the same thing is working fine in Xcode 10.2.1, right now I am using Xcode 13.2. If I run the same code in Xcode 10.2.1 then its works fine, but the same code not working in Xcode 13.2 can Anyone Help me?
3
0
2.9k
Feb ’22
Crash on iOS 15: libobjc.A.dylib objc_release+8
Too many objc_release crashes on iOS15, kindly help check. @eskimo Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x2468 objc_release + 8 1 libobjc.A.dylib 0x65c8 AutoreleasePoolPage::releaseUntil(objc_object**) + 196 2 libobjc.A.dylib 0x2e30 objc_autoreleasePoolPop + 204 3 CoreFoundation 0x1306c _CFAutoreleasePoolPop + 28 4 CoreFoundation 0xc3f0 __CFRunLoopPerCalloutARPEnd + 44 5 CoreFoundation 0xb1cc __CFRunLoopRun + 2596 6 CoreFoundation 0x1de1c CFRunLoopRunSpecific + 572 7 GraphicsServices 0x19a0 GSEventRunModal + 160 8 UIKitCore 0x4ec600 -[UIApplication _run] + 1080 9 UIKitCore 0x281b08 UIApplicationMain + 2028 10 PaytmFirstGames 0x46110 main + 14 (AppDelegate.swift:14) 2022-01-18_08-44-00.2730_+0530-980fbb8be993f226da5e9f05b74c3b430ab9139.crash
1
0
1.6k
Feb ’22
XCode issue
Hi all, Just encountered an issue with XCode after I accidentally deleted some constraints for a button on a app I'm building for class--during this process, I accidentally removed the: main.storyboard file from the View file. In an attempt to reestablish it/finding the main.storyboard (I did not find a way to find/reestablish main.storyboard) I first: deleted the entire app project and then encountered an issue where XCode froze thus I restarted my MAC--no avail, XCode is no longer opening up. Ideas? Thank you so much for your time. yoliO
0
0
763
Jan ’22
Swift Frontend RAM usage
I am new to Swift and have been playing around in Xcode and following tutorials but I have noticed that even when following these tutorials the 'swift-frontend' process is taking in excess of 50GB of memory once hitting 80GB. I have a Mackbook Pro with 16GB or RAM but cant figure out what is wrong. I did read about memory leaks but wouldn't thing it was an issue as I have learning by copying code from a tutorial. I'm very unsure though as to what is happening and how to fix it and am hoping I could get some help here.
2
0
1.6k
Dec ’21
enablePerformanceTestsDiagnostics option not working
I'm using Xcode 13.0 (13A233). I want to access the "enablePerformanceTestsDiagnostics" feature. When I enter "xcodebuild test -project PerformanceTest.xcodeproj -scheme PerformanceTest -destination "platform=iOS Simulator,id=D43B8013-11A6-4E66-A42A-7174B9109276" -enablePerformanceTestsDiagnostics YES" command in the terminal,the xcresult did not produce the memgraphset.zip file for me. I don't know why this happened, Any one can confirm if this is a bug or give me some hints about my operation.
1
0
1.2k
Oct ’21
Received memory pressure event 16 vm pressure 0 in app
My iPhone iOS is 13.6 and app is in flutter.When I am trying to zoom in and to in my graph , my app crashes with the following error: Received memory pressure event 16 vm pressure 0 2021-10-06 17:29:27.964972+0530 Connect[2313:82660] [client] No error handler for XPC error: Connection interrupted 2021-10-06 17:29:29.142879+0530 Connect[2313:80373] flutter: serverTxCharUuid value BLE layer [151, 0, 195, 249, 67, 255, 158, 60, 9, 250, 129, 126, 134, 22, 109, 29, 5, 108, 254, 8] device id 4523D097-8ED9-FA29-3740-78B2EB104903 2021-10-06 17:29:29.158260+0530 Connect[2313:80373] flutter: serverDataList count 0 thread #9, name = 'io.flutter.1.ui', stop reason = EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=1450 MB, unused=0x0)     frame #0: 0x00000001a0aea168 libsystem_malloc.dylib`tiny_malloc_from_free_list + 312 libsystem_malloc.dylib`tiny_malloc_from_free_list: ->  0x1a0aea168 <+312>: str    x9, [x10]     0x1a0aea16c <+316>: b      0x1a0aea5d4               ; <+1444>     0x1a0aea170 <+320>: mov    w11, #0x1     0x1a0aea174 <+324>: lsl    w11, w11, w8 Target 0: (Connect) stopped. Lost connection to device.
0
0
1.3k
Oct ’21
Duplicate Keys of Type 'EKEvent' were found in a Dictionary
I have been playing around with EventKit recently and I added a fetch request for all Events in my calendar. But after like 20 seconds after launch, I get this error: Fatal error: Duplicate keys of type 'EKEvent' were found in a Dictionary. This usually means either that the type violates Hashable's requirements, or that members of such a dictionary were mutated after insertion. 2021-06-22 08:56:13.202792+0200 Assisty[1779:332215] Fatal error: Duplicate keys of type 'EKEvent' were found in a Dictionary. This usually means either that the type violates Hashable's requirements, or that members of such a dictionary were mutated after insertion. 2021-06-22 08:57:03.745222+0200 Assisty[1779:332215] [error] precondition failure: setting value during update: 1560 I am a beginner to Xcode debugging and SwiftUI, but I can see that it thinks I have mutated something when I haven't. My app only fetches events from the user calendar and stores it in a variable of type [EKEvent]. I have no idea why this error is happening and my app is crashing left and right for no clear reason. If any one has seen this error and knows how to fix this I would really appreciate the help. Thanks a lot
3
0
2.1k
Jul ’21
PHPickerViewController causes memory link
I want to pick an image with PHPickerViewController. But this causes to memory link. Can anyone help me with this issue?( I created ImagePickerManager and I'm using it on ViewController below. P.s: I didn't get a leak when writing the same code with UIImagePickerViewController. import Foundation import Photos import PhotosUI class ImagePickerManager: NSObject {   // MARK: Variables   var accessType: PHAccessLevel = .addOnly   var pickerViewController = PHPickerViewController(configuration: PHPickerConfiguration())   //var viewController: UIViewController?   var pickImageCallback : ((UIImage) -> ())?;   // MARK: Init   override init() {     super.init()     setupPhotoPicker()     setupPhotoLibrary(accessType)   } //  convenience init( //    viewController: UIViewController, //    accessType: PHAccessLevel = .addOnly) { //      self.init() // //      self.viewController = viewController //      setupPhotoLibrary(accessType) //      setupPhotoPicker() //    }   // MARK: Setup   private func setupPhotoLibrary(_ accessType: PHAccessLevel) {     self.checkAuthorizationStatusForPhotoLibrary()     self.accessType = accessType   }   private func setupPhotoPicker() {     pickerViewController.delegate = self   }   // MARK: Present PickerController   func presentPHPicker(_ viewContr: UIViewController,_ callback: @escaping ((UIImage) -> ())) {     pickImageCallback = callback    // self.viewController = viewContr     viewContr.present(pickerViewController, animated: true)   }   // MARK: Checking status of Photo library access   func checkAuthorizationStatusForPhotoLibrary() {     switch PHPhotoLibrary.authorizationStatus(for: accessType) {     case .authorized: break     case .notDetermined:       self.requestAuthorizationForPhotoLibrary()     case .denied:       self.showAccessDeniedMessage()     default: return     }   }   // MARK: Request to Access Photo Library   func requestAuthorizationForPhotoLibrary () {     PHPhotoLibrary.requestAuthorization(for: accessType) { status in       switch status {       case .authorized:         print("Access granted")       case .denied: break       case .notDetermined: break       default: return       }     }   }   // MARK: Access Denied to do action   private func showAccessDeniedMessage() {     print("\n ShowAccessDeniedMessage \n")   } } // MARK: - PHPickerViewControllerDelegate extension ImagePickerManager: PHPickerViewControllerDelegate, UINavigationControllerDelegate {   func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {     picker.dismiss(animated: true, completion: nil)     for result in results {       result.itemProvider.loadObject(ofClass: UIImage.self, completionHandler: { (object, error) in         if let image = object as? UIImage { //          DispatchQueue.main.async {             // Use UIImage             self.pickImageCallback?(image) //          }         }       })     }   } } /// -------- ViewController let imageManager = ImagePickerManager()   @objc func pressedButton() {     imageManager.presentPHPicker(self) { image in       print("something...")     }   }
Replies
2
Boosts
0
Views
1.7k
Activity
Apr ’22
boringssl_metrics_log_metric_block_invoke(151) Failed to log metrics
Just Created one Login screen and its UI, UI is custom reads all properties from the local JSON file, like color, button shape, background color, icon URL, etc. Used one Framework which I have created for my UI, and just drag and drop that framework (No API calls in that Framework) but when I run my project my UI gets stuck, Not able to click any button or text field. and I am getting the following error boringssl_metrics_log_metric_block_invoke(151) Failed to log metrics  also, My CPU use is 100% and my app is getting stuck (see screenshot) Memory is increasing to 6 to 7 GB. but the same thing is working fine in Xcode 10.2.1, right now I am using Xcode 13.2. If I run the same code in Xcode 10.2.1 then its works fine, but the same code not working in Xcode 13.2 can Anyone Help me?
Replies
3
Boosts
0
Views
2.9k
Activity
Feb ’22
Why vmmap shows that footprint is less than dirty size
I use vmmap check my app’s memory,find that dirty memory is bigger than footprint ,the physical footprint is 1.8 g, but dirty size is 2.3g,why?
Replies
1
Boosts
0
Views
1k
Activity
Feb ’22
Crash on iOS 15: libobjc.A.dylib objc_release+8
Too many objc_release crashes on iOS15, kindly help check. @eskimo Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x2468 objc_release + 8 1 libobjc.A.dylib 0x65c8 AutoreleasePoolPage::releaseUntil(objc_object**) + 196 2 libobjc.A.dylib 0x2e30 objc_autoreleasePoolPop + 204 3 CoreFoundation 0x1306c _CFAutoreleasePoolPop + 28 4 CoreFoundation 0xc3f0 __CFRunLoopPerCalloutARPEnd + 44 5 CoreFoundation 0xb1cc __CFRunLoopRun + 2596 6 CoreFoundation 0x1de1c CFRunLoopRunSpecific + 572 7 GraphicsServices 0x19a0 GSEventRunModal + 160 8 UIKitCore 0x4ec600 -[UIApplication _run] + 1080 9 UIKitCore 0x281b08 UIApplicationMain + 2028 10 PaytmFirstGames 0x46110 main + 14 (AppDelegate.swift:14) 2022-01-18_08-44-00.2730_+0530-980fbb8be993f226da5e9f05b74c3b430ab9139.crash
Replies
1
Boosts
0
Views
1.6k
Activity
Feb ’22
XCode issue
Hi all, Just encountered an issue with XCode after I accidentally deleted some constraints for a button on a app I'm building for class--during this process, I accidentally removed the: main.storyboard file from the View file. In an attempt to reestablish it/finding the main.storyboard (I did not find a way to find/reestablish main.storyboard) I first: deleted the entire app project and then encountered an issue where XCode froze thus I restarted my MAC--no avail, XCode is no longer opening up. Ideas? Thank you so much for your time. yoliO
Replies
0
Boosts
0
Views
763
Activity
Jan ’22
Swift Frontend RAM usage
I am new to Swift and have been playing around in Xcode and following tutorials but I have noticed that even when following these tutorials the 'swift-frontend' process is taking in excess of 50GB of memory once hitting 80GB. I have a Mackbook Pro with 16GB or RAM but cant figure out what is wrong. I did read about memory leaks but wouldn't thing it was an issue as I have learning by copying code from a tutorial. I'm very unsure though as to what is happening and how to fix it and am hoping I could get some help here.
Replies
2
Boosts
0
Views
1.6k
Activity
Dec ’21
enablePerformanceTestsDiagnostics option not working
I'm using Xcode 13.0 (13A233). I want to access the "enablePerformanceTestsDiagnostics" feature. When I enter "xcodebuild test -project PerformanceTest.xcodeproj -scheme PerformanceTest -destination "platform=iOS Simulator,id=D43B8013-11A6-4E66-A42A-7174B9109276" -enablePerformanceTestsDiagnostics YES" command in the terminal,the xcresult did not produce the memgraphset.zip file for me. I don't know why this happened, Any one can confirm if this is a bug or give me some hints about my operation.
Replies
1
Boosts
0
Views
1.2k
Activity
Oct ’21
Received memory pressure event 16 vm pressure 0 in app
My iPhone iOS is 13.6 and app is in flutter.When I am trying to zoom in and to in my graph , my app crashes with the following error: Received memory pressure event 16 vm pressure 0 2021-10-06 17:29:27.964972+0530 Connect[2313:82660] [client] No error handler for XPC error: Connection interrupted 2021-10-06 17:29:29.142879+0530 Connect[2313:80373] flutter: serverTxCharUuid value BLE layer [151, 0, 195, 249, 67, 255, 158, 60, 9, 250, 129, 126, 134, 22, 109, 29, 5, 108, 254, 8] device id 4523D097-8ED9-FA29-3740-78B2EB104903 2021-10-06 17:29:29.158260+0530 Connect[2313:80373] flutter: serverDataList count 0 thread #9, name = 'io.flutter.1.ui', stop reason = EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=1450 MB, unused=0x0)     frame #0: 0x00000001a0aea168 libsystem_malloc.dylib`tiny_malloc_from_free_list + 312 libsystem_malloc.dylib`tiny_malloc_from_free_list: ->  0x1a0aea168 <+312>: str    x9, [x10]     0x1a0aea16c <+316>: b      0x1a0aea5d4               ; <+1444>     0x1a0aea170 <+320>: mov    w11, #0x1     0x1a0aea174 <+324>: lsl    w11, w11, w8 Target 0: (Connect) stopped. Lost connection to device.
Replies
0
Boosts
0
Views
1.3k
Activity
Oct ’21
Strange Undetectable memory leak
I manually created a memory leak, but the Debug Memory Graph cannot detect it. This only happens on the controller, not on the general object type. Any one konw why?
Replies
0
Boosts
0
Views
431
Activity
Sep ’21
com.apple.developer.kernel.increased-memory-limit problem.
I tried to add com.apple.developer.kernel.increased-memory-limit entitlements, but don't know which capability to add.
Replies
2
Boosts
0
Views
1.5k
Activity
Aug ’21
Heating issue iPhone 12
There’s too much heating issues with iPhone 12. It gets heated just using the iPhone for short time. So will it be resolved in upcoming updates or not?
Replies
0
Boosts
0
Views
504
Activity
Aug ’21
Duplicate Keys of Type 'EKEvent' were found in a Dictionary
I have been playing around with EventKit recently and I added a fetch request for all Events in my calendar. But after like 20 seconds after launch, I get this error: Fatal error: Duplicate keys of type 'EKEvent' were found in a Dictionary. This usually means either that the type violates Hashable's requirements, or that members of such a dictionary were mutated after insertion. 2021-06-22 08:56:13.202792+0200 Assisty[1779:332215] Fatal error: Duplicate keys of type 'EKEvent' were found in a Dictionary. This usually means either that the type violates Hashable's requirements, or that members of such a dictionary were mutated after insertion. 2021-06-22 08:57:03.745222+0200 Assisty[1779:332215] [error] precondition failure: setting value during update: 1560 I am a beginner to Xcode debugging and SwiftUI, but I can see that it thinks I have mutated something when I haven't. My app only fetches events from the user calendar and stores it in a variable of type [EKEvent]. I have no idea why this error is happening and my app is crashing left and right for no clear reason. If any one has seen this error and knows how to fix this I would really appreciate the help. Thanks a lot
Replies
3
Boosts
0
Views
2.1k
Activity
Jul ’21