linkedin Mobile App Test Archives - pCloudy

Memory Leaks & Memory Consumption by Mobile Applications

Anshuman Chatterjee
By Anshuman Chatterjee
June 28, 2017
5 min Read
Share This Article
Memory Leaks & Memory Consumption by Mobile Applications

Uncover Memory Leaks by Mobile Apps

Mobile apps can often crash for many reasons. Nothing is as excruciating as memory leaks. It starts with your app crashing often, or becoming slow or maybe making your entire phone slow down, taking longer time to load activities. Memory leaks are notoriously hard to detect, and thus can easily surprise you. Have we ever thought why most of the users uninstall the application after some use?

Which is why it is critical for Developers to understand the memory consumption by any mobile application. How do you detect memory leaks during Mobile Application Testing? And if so, how can you prevent them from hogging mobile resource consumption?

A little knack for Mobile Application Testing always comes handy.

mobile application testing
Figure 1: Image Credit- GadgetHacks

Want to test your Mobile App?

Join pCloudy Platform!

Memory is critical to device

Memory is one of the key resources of the mobile device.And memory leaks in Android is an important thing to be kept in mind. Java is a garbage collecting language, which removes the need for developers to dig deep to manage allocated memory. This reduces the chances of any segmentation fault crashing an app or any unfreed memory allocation from eating up space of the heap area, thus creating a safer code.

However, a garbage collector is never an insurance against memory leaks. There are other ways by which memory can be leaked within Java. This means that your android mobile application is still pretty prone to wasting unnecessary memory allocation and crashing with out-of-memory (OOM) errors.

Toptal
Figure 1: Image Credit- Toptal

Why are Memory Leaks Bad?

Cause: Memory leaks occur when some variable of the application still has references to some objects that are unnecessary, no longer in use or used to be with the app anymore, is bloating the allocated memory heap and the Garbage Collector is not being able to release that memory.

Effect: Android devices mostly run on phones with limited memory, so as a result of too many leaks, the app runs out of available memory. This triggers more frequent Garbage Collector events which paralyze the device (Stop-the-world GC events) by almost stopping the rendering of UI and processing of events. This leads to an Out of Memory Exception and translates to the user as the app being unresponsive.

Android App Testing

Testing for Memory Leaks

Memory Leaks are caused by the failure to not be able to de-allocate memory that is no longer in use, which is why they cannot be identified during black box testing. The best phase to find the memory leaks is when developers are developing the application, at a code level.

It’s best to check for memory leaks during unit testing. However, testers can follow these tips:

Release Unused Memory: Memory leaks can be present because of the bad design of the application and thus might consume lot of memory when the application is in use

Test on Multiple devices:The memory consumption by the application should be monitored while doing the system & functional testing. One shouldn’t rely on a single device testing as there are plethora of devices in the market.

Detecting Memory Leaks

There are quite a few techniques and tools devised by developers to pin point memory leaks. Android’s very own Android Studio has a powerful tool to monitor not only memory usage but also for network, GPU and CPU usage as well, called the Android Monitor.

Memory Monitor in this helps track memory usage, find de-allocated objects, identify memory leaks and helps get an overall sense of how your app allocates and frees memory. It’s done in three steps:

1. During and use and debugging of app, track the memory monitor. If the memory usage graph rises for your app and doesn’t fall even if put in background, it’s a memory leak.

2. Using the Allocation tracker, you can check the percentage of memory allocated to different types of variables in your app. This gives you a sense of how much memory is consumed by which object.

3. Create a Java Heap Option to create a heap dump that keeps a snapshot of the memory at any given point of time, thus providing the data consumption data.

Despite Android’s monitor to detect memory leaks, there are a few platforms from developers that help extract memory consumption data without so many steps for faster testing cycles.

pCloudy’s very own platform for example, generates the statistics for Memory consumption while doing the normal functional Mobile Application Testing on real mobile devices.It also generates other vital data such as CPU consumption, battery consumption & data consumption for testers and developers who reiterate several test cycles across multiple physical devices.

mobile application testing
Figure 1: Image Credit- Android Developers Studio

Want to test your Mobile App?

Join pCloudy Platform!

Anshuman Chatterjee
Anshuman Chatterjee

Anshuman Chatterjee is a technical consultant at pCloudy who enjoys traveling and singing. When he is not working, you would find him reading Sidney Sheldon and Agatha Christie.

Related Articles

April 19, 2020
What’s New In pCloudy 5.6?

pCloudy is committed to delivering the best solutions in mobile app testing and therefore we come up with product updates at regular intervals. This time we are thrilled to announce the release of pCloudy 5.6 with exciting new features to…

Learn More Arrow

March 17, 2020
Ensure Continuous Productivity By Leveraging Remote Devices For Mobile App Testing

Remote working is going to be a new normal and remote access tools and platforms will play a key role in maintaining productivity. Working from home has many advantages both for enterprises and teams. There are many tools that help…

Learn More Arrow

January 31, 2020
5 Best Python Frameworks For Test Automation In 2020

Testing framework plays a crucial role in the success of any automated testing process. Choosing the right test automation framework is important as it will maximize the test coverage and improve test efficiency which means a better return on investment.…

Learn More Arrow

“Representative Mobile App Functional Test Automation Vendors (Commercial)” in Gartner’s Market Guide for Mobile App Test Automation Tools

Avinash
By Avinash
August 4, 2016
2 min Read
Share This Article
“Representative Mobile App Functional Test Automation Vendors (Commercial)” in Gartner’s Market Guide for Mobile App Test Automation Tools

Gartner’s Market Guide

Delhi, June 23, 2016 – Smart Software Testing Solutions (SSTS), a leading provider of Mobile App Test Automation Tools, today announced that it has been identified as one of the Representative Mobile App Functional Test Automation vendors in the Gartner’s Market Guide for Mobile App Test Automation Tools(1).SSTS was named in the category of commercial vendors with functional test automation and device cloud capabilities.

According to Gartner, ‘’the need for automation in mobile app testing is driven by business time-to- market demands and digitalization initiatives. These push mobile app development teams to adopt agile development approaches to deliver high-quality mobile apps faster. This rapid pace, combined with a broad and changing device ecosystem, creates a challenging environment in which to maintain a high level of quality. Without automation, it will end up crushing all but the most trivial app efforts.’’

“We believe our inclusion as a representative vendor in the Gartner Market Guide validates why the world’s best-known brands rely on SSTS, to drive their Mobile Test Automation,’’ said Avinash Tiwari, Director, Smart Software Testing Solutions, explaining the unique position of the company in the Indian market.

pCloudy is the flagship product company of SSTS (Smart Software Testing Solutions). Avinash Tiwari opines that the market in India is becoming more and more receptive of automated testing solutions and cloud based testing platforms. More and more organizations are feeling pressure to make releases more frequently. Moreover, creating right test infrastructure for mobile Apps is a key concern for organizations. pCloudy is in a unique position to serve both the challenges.

If you have a Gartner Account, you can download the report by clicking on this link.

Gartner Disclaimer

Gartner does not endorse any vendor, product or service depicted in its research publications, and does not advise technology users to select only those vendors with the highest ratings or other designation. Gartner research publications consist of the opinions of Gartner’s research organization and should not be construed as statements of fact. Gartner disclaims all warranties,expressed or implied, with respect to this research, including any warranties of merchantability or fitness for a particular purpose.

(1) Gartner, Inc. ‘’Market Guide for Mobile App Test Automation Tools’’ by MaritessSobejana, Adrian Leow, 25 April 2016

Avinash
Avinash

Avinash Tiwari is a thought leader, a recognized keynote speaker, and the co-founder of pCloudy.com. He has 15+ experience in Product development and Testing. He brings with him a passion for emerging technology and quick adoption, both of which have solidified his reputation as a leader in the mobile app testing field.

Related Articles

August 4, 2020
UST Global invests in pCloudy

We feel elated to inform you all that UST Global, a digital transformation solutions company, has announced a strategic investment in Smart software testing solutions (SSTS) Inc. The UST Global team sees great potential in our SaaS platforms - pCloudy…

Learn More Arrow

April 19, 2020
What’s New In pCloudy 5.6?

pCloudy is committed to delivering the best solutions in mobile app testing and therefore we come up with product updates at regular intervals. This time we are thrilled to announce the release of pCloudy 5.6 with exciting new features to…

Learn More Arrow

November 4, 2019
Flutter App Automation Using Appium Flutter Driver

Flutter has been creating waves in the app development space since its launch. The reason is simple, it solves the problem of creating two different codebases for a single app to run on Android and iOS devices. Some experts say…

Learn More Arrow

Experience pCloudy Today

Tickmark No Credit Card Required
Tickmark Exceptional Security

Copyright All Rights Reserved © 2020