Tools for App's Performance and Memory Analyzing. Lemberg's Methods

13 Nov 2016
Tools for App's Performance and Memory Analyzing
By Anver and Vasyl

Nowadays, as far as testing of mobile extensions goes, as earlier the main concern is still performance and analysis of memory management. You can find various articles, tips, tools, and services online as well as guides on how to use them properly. The majority of them are not free and require a great deal of time in order to be set up and analyze processes correctly. In the article below, you’ll find that we provided some quick textbook-based methods that serve as tools for most testers. Below, you’ll find a more in-depth elaboration of these tools and services that we utilized in our own process.

What we use to analyze app’s performance?

Android

TestFairy monitors each and every possible aspect of an application and generates reports. It monitors sessions, battery life, CPU usage, allocated runtime memory, threads and more. All this, again, with no additional configuration or integration of their SDK.

Memory Performance chart

Blue line shows private memory. Red line shows shared memory. Numbers in bytes.

CPU Performance chart

This graph shows the CPU usage (in jiffies) in user mode and kernel mode of the current process. The graph may show values higher than 100, depends on the number of CPU cores on the device.

Device: Android Developer Options

The Developer Options menu in Android is a hidden menu with a variety of advanced options. In Android 4.2+, the Developer Options menu and USB Debugging option have been hidden. To enable them go to Settings > About phone > Build number tap on the section 7 times

These options are intended for developers, but many of them will be interesting to QA:

  • Don't keep activities: When this option is enabled, the Android OS will destroy an activity as soon as it is stopped. It is intended to help developers debug their apps. For example, it can simulate the case that Android will kill an activity in the background due to memory pressure.
  • Show Always-On-Top CPU Usage: You can view CPU usage data by toggling the Show CPU usage option to On. This information will appear on top of whatever app you’re using. 
  • Process Stats: Android 4.4 includes a new developer option to make it easier to analyze your app's memory profile while it's running on any device or emulator.

What we use to analyze app’s memory management?

Android

Viewing Heap Updates - Dalvik Debug Monitor Server (DDMS)

Caynax Task manager is an easy and simple way to manage running applications. This is not a typical task killer (although it can kill apps).

The application contains:

  • a list of all running applications (processes), with current data about memory and CPU usage
  • sorting, filtering and searching the list of applications
  • information about memory usage and CPU for the entire system (graph)
  • lots of useful information about the selected application along with graph of memory and CPU usage
  • killing, uninstalling or launching an application
  • application log (logcat)

Device: Android Developer Options 

The Developer Options menu in Android is a hidden menu with a variety of advanced options. In Android 4.2+, the Developer Options menu and USB Debugging option have been hidden. To enable them go to Settings > About phone > Build number tap on the section 7 times. These options are intended for developers, but many of them will be interesting to QA:

Process Stats: Android 4.4 KitKat introduced a new system service called procstats that helps you better understand how your app is using the RAM resources on a device. Procstats makes it possible to see how your app is behaving over time — including how long it runs in the background and how much memory it uses during that time. It helps you quickly find inefficiencies and misbehaviors in your app that can affect how it performs, especially when running on low-RAM devices.

iOS

Finding Leaks Using InstrumentsXcode

The Instruments application can be used to find leaks in both OS X and iPhone applications. To find leaks, create a new document template in Instruments and add the Leaks instrument to it. The Leaks instrument provides leak-detection capabilities identical to those in the leaks command-line tool.

As far as performance goes, we can verify based on our experience and testing that utilizing TestFairy as an analyzer of extensions is very convenient and working with it doesn't require too much effort in setting up this process.

Thanks to TestFairy, it's possible to monitor every session, battery life, CPU usage, allocated runtime memory, threads and more. Perhaps, one of the most important advantages is that TestFairy doesn't require integration of their SDK, and this simplifies and facilitates the process significantly and also conserves one time doing it. Another quite simple method of analysis is CPU usage data on Android devices and this can be set up by toggling the “Show CPU usage option” to ON in smaphone’s settings.

In regards to analysis of memory management, whether it be on an iOS or Android platform, it can be done with the help of native tools such as DDMS and Leaks tool with the help of Caynax Task manager. By the way, if you  have the app idea in mind, but don't know where where to start, we're here to help you

SEE ALSO: