Memory debuggers work by monitoring memory access, allocations, and deallocation of memory. Many memory debuggers require applications to be recompiled with special dynamic memory allocation libraries, whose APIs are mostly compatible with conventional dynamic memory allocation libraries, or else use dynamic linking.
Electric Fence is such a debugger which debugs memory allocation with
malloc. Some memory debuggers (e.g.
Valgrind) work by running the executable in a virtual machine-like environment, monitoring memory access, allocation and deallocation so that no recompilation with special memory allocation libraries is required. Finding memory issues such as leaks can be extremely time-consuming as they may not manifest themselves except under certain conditions. Using a tool to detect memory misuse makes the process much faster and easier. As abnormally high memory utilization can be a contributing factor in
software aging, memory debuggers can help programmers to avoid
software anomalies that would exhaust the computer system memory, thus ensuring high reliability of the software even for long
runtimes. ==Comparison to static analyzer==