top of page
  • Writer's pictureDon Peter

How to Detect Memory Leaks in WatchOS apps that are created using Objective-C or Swift

Updated: Sep 24, 2022

Memory leak is a critical bug in watchOS apps, that often go unnoticed during development. Memory leaks can lead to EXC_BAD_ACCESS error and will manifest as app crashes in watchOS.


Memory leaks are caused when unused objects are not cleared from memory. It slows down the app, which affects the experience of the user. So detecting and fixing memory leaks as fast as possible is important for maintaining good user experience and thus retaining users. Tools like XCode Leaks Instrument available for watchOS will help developers detect memory leaks during the development of apps.


There are situations where developers tend to miss figuring out leaks during development. Such leaks are very likely to manifest in production.


This is where Finotes come in. Finotes watchOS framework monitors InterfaceControllers for retained objects and reports it in real-time.

Finotes detects memory leaks in watchOS apps just by extending InterfaceControllers from ObservableInterfaceController, a custom InterfaceController class provided by Finotes.


Objective-c Integration

@interface ProfileController : ObservableInterfaceController

@end

Swift Integration

class ProfileController: ObservableInterfaceController {

}

Find the detailed documentation for Objective-C & Swift, on how to track memory leaks.


Finotes reports memory leaks with relevant data points like leaked InterfaceController name, activity trail, device info, and device state info. This will help the developers to reproduce the memory leaks and find the root cause.


Here is a screenshot of the memory leak detected by Finotes in a live watchOS app.

Memory leak detected by Finotes framework in production watchOS Apps
Memory Leak in watchOS apps

Memory leak bug report provides the name of the InterfaceController where the leak occurred along with the total memory consumed by the app.


Apart from memory leaks, Finotes also detects API call issues, frame rate issues, abnormal memory usage, crashes, exceptions, function failures & delays along with custom issues.

For knowing more about how Finotes detects memory leaks in iOS apps, please read our blog post Detect memory leaks in iOS (Objective-C & Swift).

Visit finotes.com to know more about Finotes. Detailed documentation is available at docs.finotes.com.


Related Blog Posts

Blog for Mobile App Developers, Testers and App Owners

 

This blog is from Finotes Team. Finotes is a lightweight mobile APM and bug detection tool for iOS and Android apps.

In this blog we talk about iOS and Android app development technologies, languages and frameworks like Java, Kotlin, Swift, Objective-C, Dart and Flutter that are used to build mobile apps. Read articles from Finotes team about good programming and software engineering practices, testing and QA practices, performance issues and bugs, concepts and techniques. 

bottom of page