Friday, May 27, 2011

Memory leaks in software and epilepsy

EEG shows abnormal activity in some types of s...Image via Wikipedia
We all know what impact memory leaks have and how hard - at least sometimes - they are to detect. Often, there are small, but repeating leaks and over time they add up to either resource issues, weird application behavior or crashes.

Epilepsy can be similar. Sometimes, it can be spotted easily, sometimes it is hard to detect. In the case of my son, we didn't notice his condition for some years. There are many causes for epilepsy, e.g., in his case a brain tumor. It was constantly "nagging" the surrounding parts of his brain. Over time it added up and then caused (relatively mild) seizures. Initially they were seldom and infrequent. Every few weeks we spotted some short, but weird or strange acting of our son. When the pediatrician suspected epilepsy the first time and EEGs of different duration were ordered, nothing special was found. That's when a MRI was done and eventually the tumor was detected. Next on the list was a visit to an epilepsy monitoring unit (EMU) with week-long 24x7 EEG, video and audio capture. All the activity was necessary to track down and understand my son's epilepsy.

When you know (or think) that there is a memory leak inside your application, there are different ways to try to find it. These days, there are tools to assist. Sometimes, still the leak cannot be easily found or its impact easily seen - similar to epilepsy and what it is causing.

At IBM we use and recommend IBM Rational Purify to detect memory leaks in software. DB2 offers the db2mtrk tool to show you how memory is used and db2top can also show you such information.