Skip to main content

3 posts tagged with "Memory"

View All Tags

How to Detect Abnormal Memory Usage and Memory Spikes in iOS Apps

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

Though it is often advised to keep the app’s memory footprint as low as possible, developers tend to overlook this aspect during app development. As a result, the elements that consume the app’s memory go unchecked, which leads to the app consuming an abnormal amount of the device’s memory.

When the iOS app consumes a considerable amount of allocated memory, it leads to an out of memory exception, resulting in an app crash and affecting user experience. This makes it important for developers to be notified about abnormal memory usages in both development and production environments at the earliest.  

Abnormal memory usage occurs when unused memory is not reclaimed properly or because of inefficient object reuse.

With Appxiom, abnormal memory usage can be detected at the earliest and developers get to fix the issue fast.Appxiom is an automated bug reporting tool that is capable of detecting abnormal memory usages and memory spikes in iOS apps.

Using Appxiom to track memory issues in iOS

With a simple 3-step integration process, Appxiom framework for iOS detects and reports abnormal memory usage in both development and production environments. Please visit our documentation page for more details. 

Tracking memory usage with Activity trail

Appxiom reports high memory usage when the iOS app consumes more than 30% of the physical memory. The bug report will have data points like activity trail with memory usage patterns along with device and device state information, which will aid developers to reproduce the bug. 

Activity Trail from an issue reportActivity trail consists of a list of events that occurred one minute prior to the issue occurrence. The app events along with the percentage of free memory available at each point are displayed in a chronological order. 

Components of Activity trail

Section of Activity Trail

Activity

The activity segment has details of the app events. The user event will have two components separated by a colon

  •  The name of the class in which the event gets reported

  •  The textual description of the event.

Timestamp

The timestamp segment has details related to the time at which the event gets recorded. 

Free Memory

The memory segment also contains the percentage of free memory available for the app at the time of the event. 

How Appxiom helps in finding the root cause

Abnormal memory usage reported by AppxiomLet’s consider a use case as indicated in the above screenshot. Here, Appxiom has detected high memory usage in an iOS app. The issue is that the app’s memory usage crossed 2587213824 bytes, which is more than 30% of the physical memory size i.e 8589934592 bytes. 

With an in-depth evaluation of the activity trail section in the issue report, we understand that while loading the first banner image, the free memory was around 79%. But when the final banner image was loaded, the memory dipped down to almost 71%. So with each banner image, the amount of free memory available goes down. By analysing the issue further in code, we can come to the conclusion that the root cause for the free memory dip was that the allocated objects for banner images are not released. 

This scenario may lead to an app crash. In order to avoid the app from crashing, Appxiom detects and reports whenever the app consumes more than an ideal amount of free memory.

Activity trail helps developers to pinpoint where exactly the issue is so that necessary changes can be made in the code and a patch version be released fast. 

Custom Activity Trail events

Apart from default events, Appxiom allows developers to set custom app events in activity trail (refer our Objective-C and Swift documentation) with an API, which can be called anywhere in the code. These custom events will be recorded and shown along with default app events in the activity trail section in Appxiom dashboard. 

Along with high memory usage and spikes, Appxiom also detects memory leak in iOS apps. To know more read our blog Detect memory leaks in iOS

Apart from memory-related issues, Appxiom capable of detecting and reporting crashes, API call issues, frame rate issues, ANR, function failures, exceptions, delays and custom issues.  Appxiom is available for iOS as Objective-C and Swift Frameworks, watchOS as Objective-C and Swift Frameworks, and Android as Java and Kotlin SDKs platforms. 

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

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)

Detect Memory Leaks in iOS (Objective-C & Swift)

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

Memory leak is one of the most dreadful issues developers fear. It's even bigger challenge for mobile app developers as very often the device where the issue manifests is out of their reach. Most of the time developers will not even get crash reports caused by memory leaks. They usually manifest in the form of EXC_BAD_ACCESS.

Tools like XCode Leaks Instrument for iOS help developers identify such leaks during development time itself. But what is the guarantee that all such leaks are identified and all possible use-cases are tested properly? There is no guarantee, and that is the hard truth.

So what if the developer and the tester missed some use cases and there are memory leaks happening in production? Here is where Appxiom help the developer to get notified about the issue in real-time and that too with as much relevant data as possible so that (s)he can reproduce the bug. Appxiom auto detects memory leaks.

Appxiom report bugs to the dashboard with important data such as activity trail, device info, and device state info. This will help the developer to be aware of the leaks happening in their app that is running in their users' devices and also helps them to reproduce the memory leak.

Here is a screenshot of such a leak detected by Appxiom in a live app.

With such reports, developers are notified of the occurrence of a memory leak in a ViewController. Developers can then use the Leaks instrument to drill down the corresponding ViewController for the leak.

Apart from memory leaks, Appxiom detects API call issues, frame rate issues, abnormal memory usage, crashes, exceptions, function failures & delays. It also has the capability to report custom issues. The memory leak detection is available in our iOS Framework starting from version 3.1.0. For knowing more about how Appxiom detects memory leaks in Android apps, read the blog How to detect bugs in Android.

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

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