Writing Defensive Code to Automatically Find Memory Leaks In an earlier post, I suggested making all your memory allocations go through a single routine, and deletions through another. When you centralize allocation and deallocation like this, you gain a couple of benefits. First of all, you make the memory allocation more explicit, which will tend to make programmers more careful. Second, you can… View Article
How To Find a Memory Leak Finding memory leaks and other problems in your code can be challenging, but there are tools available to help simplify that process. Remember to add time to your schedule so that you can apply the available tools for finding memory leaks and other problems.
Ben’s Golden Rule for Preventing Memory Leaks As an embedded software engineer, I spend the majority of my time writing code in C and C++. One somewhat-justified knock on these languages is that they both force the programmer to sweat all the details involved with memory management. One particular bugaboo of the C/C++ engineer is the memory leak: Memory that is dynamically… View Article