Memory debugger




























A memory debugger also known as a runtime debugger[1] is a debugger for finding software memory problems such as memory leaks and buffer overflows. These are due to bugs related to the allocation and deallocation of dynamic memory. Programs written in languages that have garbage collection, such as managed code, might also need memory debuggers, e.g. for memory leaks due to "living" references in collections.




Contents






  • 1 Overview


  • 2 Comparison to static analyzer


  • 3 List of memory debugging tools


  • 4 See also


  • 5 References


  • 6 External links





Overview


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.[2]


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


Some static analysis tools can also help find memory errors. Memory debuggers operate as part of an application while it's running while static code analysis is performed by analyzing the code without executing it. These different techniques will typically find different instances of problems, and using them both together yields the best result.[3]



List of memory debugging tools


This is a list of tools useful for memory debugging. A profiler can be used in conjunction with a memory debugger.

























































































































































































Name
OS
License
Languages
Technique

AddressSanitizer
Linux, Mac OS
Free/open source (LLVM)
C, C++.
Compile-time instrumentation (available in Clang and GCC) and specialized library

Allinea DDT
Linux, Blue Gene
Proprietary commercial
C, C++ and F90. Also for parallel programs on supercomputers
Runtime - through dynamic linking

AQtime
Windows (Visual Studio, Embarcadero IDEs)
Proprietary commercial
.NET, C++, Java, Silverlight, JScript, VBScript[4]
Runtime

Bcheck
Solaris




BoundsChecker
Windows (Visual Studio)
Proprietary commercial
C++
Runtime intercepts or compile-time

Daikon
Unix, Windows, Mac OS X[5]
Free/open source[6]
Java, C/C++, Perl, and Eiffel[5]
Runtime dynamic invariant detection

Debug_new
(general technique)
(general technique)
C++
Compile-time override

Deleaker
Windows
Proprietary commercial
C++, .Net
Runtime intercepts

dmalloc
Any
Free/open source
C
Compile-time override

DynamoRIO § Dr. Memory
Android, Linux, Windows
Free/open source (LGPL and BSD)
Any
Runtime intercepts

Electric Fence
Unix
Free/open source (GPL)
C, C++
Compile-time override

FASTMM4
Windows
Free/open source (GPL)
Delphi
Compile-time override

IBM Rational Purify
Unix, Windows
Proprietary commercial
C++, Java, .NET
Runtime

Insure++
Windows (Visual Studio plugin), Unix
Proprietary commercial
C, C++
source code instrumentation

Intel Inspector
Windows (Visual Studio)
Proprietary commercial
C, C++


libcwd
Linux (gcc)
Free/open source
C, C++
Compile-time override

libumem
Solaris
Bundled with Solaris

Link-time override

Memwatch
Any (programming library)
Free/open source
C
Compile-time override

mtrace
Various
Free/open source (LGPL)
GNU C library
Built-in, outputs accesses

MTuner
Various
Free
C, C++
Runtime intercepts, Link-time override (MSVC, Clang and GCC), Leak detection

Oracle Solaris Studio (formerly Sun Studio Runtime Checking)
Linux, Solaris
Proprietary freeware
C, C++, Fortran


OLIVER (APT international)
MVS, MVS/EXA, DOS/VSE
Proprietary software
IBM Assembler
Runtime intercepts, Hypervisor - Type 2

TotalView
Unix, Mac OS X
Proprietary commercial
C, C++, Fortran
Runtime

Valgrind § Memcheck
Linux, Mac OS, Android
Free/open source (GPL)
Any
Runtime intercepts

WinDbg
Windows
Proprietary freeware
C, C++, .NET, Python
Runtime


See also




  • Profiling (computer programming)

  • List of performance analysis tools

  • Debugger

  • Runtime error detection

  • Software testing

  • Software engineering

  • Computer programming

  • Core dump



References



  • Michael C. Daconta: C++ Pointers and Dynamic Memory Management, John Wiley & Sons, .mw-parser-output cite.citation{font-style:inherit}.mw-parser-output .citation q{quotes:"""""""'""'"}.mw-parser-output .citation .cs1-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Wikisource-logo.svg/12px-Wikisource-logo.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:inherit;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{font-size:100%}.mw-parser-output .cs1-maint{display:none;color:#33aa33;margin-left:0.3em}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration,.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}
    ISBN 0-471-04998-0


  • Andrew Koenig: C Traps and Pitfalls, Addison-Wesley,
    ISBN 0-201-17928-8




  1. ^ Globus, A; Raible, E (July 1994). "Fourteen ways to say nothing with scientific visualization". IEEE Computer. 27 (7): 86–88. doi:10.1109/2.299418. Retrieved August 24, 2017.


  2. ^ "Review: 5 memory debuggers for Linux coding". Retrieved August 24, 2017.


  3. ^ "Dynamic Analysis vs. Static Analysis". Retrieved August 24, 2017.


  4. ^ http://smartbear.com/products/qa-tools/application-performance-profiling/profiling-managed-code


  5. ^ ab http://groups.csail.mit.edu/pag/daikon/download/doc/daikon.html


  6. ^ http://groups.csail.mit.edu/pag/daikon/download/doc/daikon.html#License



External links



  • "Hunting Memory Bugs" by Ivan Skytte Jørgensen

  • "Comparison of Free Memory Checkers" by Jean-Philippe Martin[full citation needed]









Comments

Popular posts from this blog

Information security

Volkswagen Group MQB platform

刘萌萌