My application was built using SwiftUI, and it is working perfectly smoothly on iOS 16.6 and all the previous versions up to iOS 15.0 But when I tried my application with the iOS 17.0 beta 3 and beta 5 and beta 7 there is always this memory issue that is causing my application to crash, and there is no clear reason why the memory keeps run out. When the application crashes after about 30 to 50 seconds, I get the error on the main thread "Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)" I tried looking for a solution online but I only found answers 9 years ago about some C language memory issues. I have also ran the instruments of Xcode to try and find the memory leak but I couldn’t know how to use them properly so I ran it on the iOS 16.6 phone and it looked really nice, and ran it on the iOS 17.0 and it showed a significant difference in memory allocation. (View the photos)
I can confirm that there are no changes to the code base while running it on iOS 16.6 and iOS 17.0 but this issue came out of nowhere. I was thinking this was an apple issue but since they did not fix it in the last 5 beta versions I started thinking that I might need to fix it on my own before apple does. because the iOS 17.0 is coming within less than 20 days. Thank you to everyone who can help me or share their thoughts about this.
- I have tried updating all the dependencies that my project is using, but the issue was not resolved.
- I waited for a few beta versions thinking it would get fixed by it's own but apparently that will not happen.
- I tried using the instruments tool but I felt like a newbie and did not find a lot of people talking about how to use the Xcode instruments properly.
- I did try to stop all the API calls and that seemed to stop the memory from being hogged, but even a single API call gets the memory to start being hogged again by the application (every second it raises more and more) (API CALLS USING COMBINE LIBRARY).
- The version that is on the app store is working without crashing on iOS 17.0 (it is a lesser version of the App like 10 builds previous to the one I am developing) (I tried to debug it, but I could not because it was an app store app which did not allow me to use the instruments on it)