Thanks For The Memory

Aug. 9, 2004
The program runs! Break out the champagne. It's time to ship. Or is it? Diagnostic tools such as debuggers and trace applications are invaluable in tracking down bugs. However, an often overlooked or unavailable tool is the...

The program runs! Break out the champagne. It's time to ship. Or is it?

Diagnostic tools such as debuggers and trace applications are invaluable in tracking down bugs. However, an often overlooked or unavailable tool is the memory-management tool. Any debugger can catch an errant pointer, but a subtle growth in the amount of memory used can come back to haunt a developer. Unlike many PC-based applications, embedded applications run forever, making it harder to discover memory leaks and other problems.

Programming languages like C, C++, and assembler are prone to memory-related problems not limited to memory leaks. Allocation speed, fragmentation, and even memory corruption issues can arise when dealing with dynamic memory management. Tools such as IBM's Rational Purify (www.ibm.com) provide more advanced memory error-detection hooks into the program's dynamic memory-allocation system. Compuware's (www.compuware.com) DevPartner Studio and Metrowerks' CodeTest can deliver a real-time graph of memory usage as well as detailed views of multiple heaps.

Moving to higher-level programming languages like Java and C++ with their use of garbage collection only eliminates dangling pointer problems. Most other memory-related problems remain, so good tools are just as important for projects using these languages. One is prone to problems with libraries like Java's collection classes and the C++ standard template library (STL). These can easily utilize much more memory than originally intended by a programmer.

Some memory-related issues are often related to the hardware employed. For example, Texas Instruments (www.ti.com) is working to develop tools that will assist in data placement to optimize cache performance on DSPs. Although improved performance is a laudable goal, the desired effect is often to reduce power consumption. Spend less time fetching information or allocating memory and more time crunching numbers. Caching policies such as write-through versus write-back can even affect performance. Cache size is another issue that crops up with custom designs. Knowing an application's memory utilization can potentially enhance system design and performance.

Most embedded developers are well aware that memory is a limited commodity, so minimizing program and data memory is desirable. Unfortunately, the tools available for gauging system requirements and diagnosing problems often are minimal at best. As a result, developers are forced to guess or create their own tools.

I have found memory-management diagnostic tools to be very handy when utilized on a regular basis. Let me know what kinds of tools you find most useful.

About the Author

William G. Wong | Senior Content Director - Electronic Design and Microwaves & RF

I am Editor of Electronic Design focusing on embedded, software, and systems. As Senior Content Director, I also manage Microwaves & RF and I work with a great team of editors to provide engineers, programmers, developers and technical managers with interesting and useful articles and videos on a regular basis. Check out our free newsletters to see the latest content.

You can send press releases for new products for possible coverage on the website. I am also interested in receiving contributed articles for publishing on our website. Use our template and send to me along with a signed release form. 

Check out my blog, AltEmbedded on Electronic Design, as well as his latest articles on this site that are listed below. 

You can visit my social media via these links:

I earned a Bachelor of Electrical Engineering at the Georgia Institute of Technology and a Masters in Computer Science from Rutgers University. I still do a bit of programming using everything from C and C++ to Rust and Ada/SPARK. I do a bit of PHP programming for Drupal websites. I have posted a few Drupal modules.  

I still get a hand on software and electronic hardware. Some of this can be found on our Kit Close-Up video series. You can also see me on many of our TechXchange Talk videos. I am interested in a range of projects from robotics to artificial intelligence. 

Sponsored Recommendations

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!