Skip to main content

HOW TO DETECT MEMORY LEAKS IN WATCHOS APPS THAT ARE CREATED USING OBJECTIVE-C OR SWIFT

Published: · Last updated: · 2 min read
Don Peter
Cofounder and CTO, Appxiom

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 Appxiom come in. Appxiom watchOS framework monitors InterfaceControllers for retained objects and reports it in real-time.Appxiom detects memory leaks in watchOS apps just by extending InterfaceControllers from ObservableInterfaceController, a custom InterfaceController class provided by Appxiom.

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.

Appxiom 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 Appxiom in a live watchOS app.

Memory Leak in watchOS appsMemory 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, Appxiom 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 Appxiom detects memory leaks in iOS apps, please read our blog post Detect memory leaks in iOS (Objective-C & Swift).

Visit appxiom.com to know more about Appxiom. Detailed documentation is available at docs.appxiom.com.

Related Blog Posts

  • How to detect memory leaks in Android

  • Detect memory leaks in iOS (Objective-C & Swift)