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.

Sponsored Recommendations

What are the Important Considerations when Assessing Cobot Safety?

April 16, 2024
A review of the requirements of ISO/TS 15066 and how they fit in with ISO 10218-1 and 10218-2 a consideration the complexities of collaboration.

Wire & Cable Cutting Digi-Spool® Service

April 16, 2024
Explore DigiKey’s Digi-Spool® professional cutting service for efficient and precise wire and cable management. Custom-cut to your exact specifications for a variety of cable ...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Comments

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