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

TTI Transportation Resource Center

April 8, 2024
From sensors to vehicle electrification, from design to production, on-board and off-board a TTI Transportation Specialist will help you keep moving into the future. TTI has been...

Cornell Dubilier: Push EV Charging to Higher Productivity and Lower Recharge Times

April 8, 2024
Optimized for high efficiency power inverter/converter level 3 EV charging systems, CDE capacitors offer high capacitance values, low inductance (< 5 nH), high ripple current ...

TTI Hybrid & Electric Vehicles Line Card

April 8, 2024
Components for Infrastructure, Connectivity and On-board Systems TTI stocks the premier electrical components that hybrid and electric vehicle manufacturers and suppliers need...

Bourns: Automotive-Grade Components for the Rough Road Ahead

April 8, 2024
The electronics needed for transportation today is getting increasingly more demanding and sophisticated, requiring not only high quality components but those that interface well...

Comments

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