Debugging Memory Problems with MemoryScape : Chapter 1 Locating Memory Problems : Your Program’s Data : The Heap : Finding Heap Allocation Problems

Finding Heap Allocation Problems
Memory allocation problems are seldom due to allocation requests. Because an operating system’s virtual memory space is large, allocation requests usually succeed. Problems most often occur if you are either using too much memory or leaking it. Although problems are rare, you should always check the value returned from calls to allocation functions such as malloc(), calloc(), and realloc(). Similarly, you should always check whether the C++ new ­operator returns a null pointer. (Newer C++ compilers throw a bad_alloc exception.) If your compiler supports the new_handler operator, you can throw your own exception.

Rogue Wave Software, Inc.
Voice: (303) 473-9118
rwonlinedocs@roguewave.com