Memory Leaks—Coding Errors or Omissions with Consequences | TechWell

Memory Leaks—Coding Errors or Omissions with Consequences

Does your mobile phone quickly run out of power? Is it sluggish and unresponsive?

You think it started getting worse after you installed that last app. Now you are angry and post a nasty comment about it online.

Of all the bugs that people hate on a smartphone, it’s the one that affects the phone’s overall performance. There is a good chance this is caused by a memory leak, as described in the "Memory Leaks Explained" video.

As you can see from the video above, memory leaks aren’t really leaks at all but applications that either are quite greedy with memory resources or forgot to give the memory back after using it. Either way, you’ve got a serious problem or a really serious problem! Memory leaks are caused by programmers who forget while coding to make sure the application returns the memory it uses.

The leak is a coding error or omission with serious consequences. Memory leaks can be found in all programming languages and all types of applications from those on your smartphone to CRM enterprise systems. Some languages might be more forgiving than others. PHP is better at memory management than C, but the potential is there in all languages.

The question isHow do you find them? In simple terms, you could just examine the task or resource manager in the operating system. This is probably not enough. You could use VMMap in conjunction with task manager. There are dozens of free tools to assist with this, and development tools have in-built abilities to source memory leaks if you are a programmer.

However, if you are a tester, you may not have access to developer tools. You will probably have to be more creative in your methods to check the application for memory leaks. First you have to ensure the tool is compatible with the language in which the program is written. And then you have to attempt to learn the possible and common types of memory issues with a particular language.

It might be efficient for a developer to verify and sign off on unit and system tests to confirm no memory leaks are happening, but that is not to say the tester couldn’t run a tool as well, Dr. Memory for example, or Chrome Developer Tools Timeline panel to monitor web memory performance. There are many apps to assist in memory management and detection on Google Play or the Google App Store.

You could use a paid-for tool to help you do the job. There are dozens out there. But ultimately the best way to prevent memory leaks and other common programming mistakes is consistent training and peer reviews. Testing for memory leaks needs to be a team effort.

How do you test for memory leaks in smartphone applications or other programs?

Up Next

About the Author

TechWell Insights To Go

(* Required fields)

Get the latest stories delivered to your inbox every week.