Memory debugger: Difference between revisions

Content deleted Content added
mNo edit summary
m Removing link(s) undefined (XFDcloser)
 
(46 intermediate revisions by 26 users not shown)
Line 1:
{{Short description|Software memory problem finder}}
{{refimprove|date=December 2011}}
{{more citations needed|date=December 2011}}
{{Program execution}}
 
A '''memory debugger''' is a [[programming tooldebugger]] for finding software memory problems such as [[memory leak]]s and [[buffer overflow]]s. These are due to [[Software bug|bugs]] related to the allocation and deallocation of [[dynamic memory]]. Programs written in languages that have [[Garbage collection (computer science)|garbage collection]], such as [[managed code]], might also need memory debuggers, e.g. for memory leaks due to "living" references in collections.
 
==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.<ref>{{cite web|url=http://www.computerworld.com/article/3003957/linux/review-5-memory-debuggers-for-linux-coding.html|access-date=August 24, 2017|title=Review: 5 memory debuggers for Linux coding|date=20 November 2015}}</ref>
 
As abnormally high memory utilization can be a contributing factor in [[software aging]], memory debuggers can help programmers to avoid [[software anomaly|software anomalies]] that would exhaust the computer system memory, thus ensuring high reliability of the software even for long [[run time (program lifecycle phase)|runtimes]].
 
==Comparison to static analyzer==
Some [[List of tools for static code analysis|static analysis tools]] can also help find memory errors. Memory debuggers operate as part of an application while its [[Execution (computing)|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.<ref>{{cite web|url=https://software.intel.com/en-us/inspector-user-guide-windows-dynamic-analysis-vs-static-analysis|access-date=August 24, 2017|title=Dynamic Analysis vs. Static Analysis}}</ref>
 
==List of memory debugging tools==
Line 22 ⟶ 29:
| Linux, Mac OS
| Free/open source (LLVM)
| C, C++., Rust
| Compile-time instrumentation (available in [[Clang]] and [[GNU Compiler Collection|GCC]]) and specialized library
|-
| [[Allinea Distributed Debugging Tool|Allinea DDT]]
| Linux, Blue Gene
| {{Proprietary}} commercial
| C, C++ and F90. Also for parallel programs on supercomputers
| Runtime - through dynamic linking
|-
| [http://www.alloclave.com Alloclave]
| Windows
| Proprietary commercial
| C++
| Compile-time
|-
| [[AQtime]]
| Windows (Visual Studio, Embarcadero IDEs)
| {{Proprietary}} commercial
| .NET, C++, Java, Silverlight, JScript, VBScript<ref>{{Cite web |url=http://smartbear.com/products/qa-tools/application-performance-profiling/profiling-managed-code |title=Managed Code - AQtime Pro &#124; SmartBear |access-date=2013-01-14 |archive-url=https://web.archive.org/web/20130919153515/http://smartbear.com/products/qa-tools/application-performance-profiling/profiling-managed-code |archive-date=2013-09-19 |url-status=dead }}</ref>
| Runtime
|-
Line 51 ⟶ 52:
| [[BoundsChecker]]
| Windows (Visual Studio)
| {{Proprietary}} commercial
| C++
| Runtime intercepts or compile-time
|-
| checker (deprecated in favor of valgrind)
| Linux, Solaris
| Free/open source (GPL)
| C
| Compile-time override
|-
| [[Daikon (system)|Daikon]]
| Unix, Windows, Mac OS X<ref name="diakon_manual">{{Cite web|url=http://groups.csail.mit.edu/pag/daikon/download/doc/daikon.html|title=The Daikon Invariant Detector User Manual}}</ref>
| Free/open source<ref>{{Cite web|url=http://groups.csail.mit.edu/pag/daikon/download/doc/daikon.html#License|title = The Daikon Invariant Detector User Manual}}</ref>
| Java, C/C++, Perl, and Eiffel<ref name="diakon_manual" />
| Runtime dynamic invariant detection
Line 73 ⟶ 68:
| Compile-time override
|-
| [http://deleaker.com [Deleaker]]
| Windows (standalone, and plugins for Visual Studio, RAD Studio, Qt Creator, CLion)
| {{Proprietary}} commercial
| C / C++, .Net, Delphi
| Runtime intercepts
|-
|[[sourceforge:projects/diagnostic/|Diagnostic]]
|Windows (Integrated or external)
|Free/open source
|C / C++ / C#
|Compile-time or run-time
|-
| [[dmalloc]]
| {{Any}}
| Free/open source ([[ISC License]])
| C
| Compile-time override
|-
| {{section link|DynamoRIO|Dr. Memory}}
| dlmalloc<ref>ftp://g.oswego.edu/pub/misc/malloc.c</ref>
| Android, Linux, Windows
| Any
| Free/open source (publicLGPL ___domainand BSD)
| C{{Any}}
| Runtime intercepts
| Compile-time override
|-
| [http://code.google.com/p/drmemory/ Dr Memory]
| Windows, Linux
| Free/open source (LGPL)
| C, C++
| Runtime
|-
| [[Duma (software)|Duma]] (fork of Electric Fence)
| Unix, Windows
| Free/open source (GPL)
| C, C++
| Compile-time override
|-
| [[Electric Fence]]
| Unix
| {{GPL-lic|Free/open source (GPL)}}
| C, C++
| Compile-time override
|-
| [[FASTMM4]]
| [http://graprof.grapentin.org graprof]
| Windows
| GNU/Linux
| {{GPL-lic|Free/open source (GPL)}}
| Delphi
| C, (C++)
| LinkCompile-time override
|-
|HP Wildebeest (WDB)<ref>http://h71028.www7.hp.com/enterprise/w1/en/os/hpux11i-developers-ecosystem.html</ref>
|
|
|
| Based on gdb
|-
| [[IBM Rational Purify]]
| Unix, Windows
| {{Proprietary}} commercial
| C++, Java, .NET
| Runtime
Line 135 ⟶ 106:
| [[Insure++]]
| Windows (Visual Studio plugin), Unix
| {{Proprietary}} commercial
| C, C++
| source code instrumentation
|
|-
| [[Intel Parallel Inspector]]
| Windows (Visual Studio), Linux
| {{Proprietary}} commercial
| C, C++, Fortran
| Runtime
|-
| [[libcwd]]
| Linux (gcc)
| Free/open source
Line 156 ⟶ 127:
|
| Link-time override
|-
| MemCheck (Hal Duston)<ref>http://hald.dnsalias.net/projects/memcheck/</ref>
| Unix, Mac OS X
| Free/open source (GPL)
| C, C++
| Compile-time override
|-
| [[Memcheck]] (Société Générale)<ref>http://v.mahon.free.fr/pro/freeware/memcheck/</ref><ref>Denis Golovan Fork: https://code.launchpad.net/~denisgolovan/memcheck/main</ref>
| Windows (Borland Delphi)
| Free/open source
| C, C++
| Compile-time override
|-
|-
| [[DDDebug]]<ref>http://ddobjects.de/</ref>
| Windows (Borland Delphi)
| Commercial
| Delphi (5 to XE7)
| Runtime
|-
| memleax<ref>https://github.com/WuBingzheng/memleax</ref>
| GNU/Linux, FreeBSD
| Free/open source (GPL)
| C, C++
| attaching running process, without recompiling or restarting target
|-
| MemPro<ref>http://www.puredevsoftware.com/MemPro.htm</ref>
| Windows (Visual Studio)
| Free beta
| C++
| Compile-time override, uses TCP connection to track memory events
|-
| [[Memwatch]]
| {{Any}} (programming library)
| Free/open source
| C
| Compile-time override
|-
| [[mpatrol]]<ref>http://mpatrol.sourceforge.net/</ref>
| Unix, Windows
| Free/open source (LGPL)
| C, C++
|
|-
| [[mtrace]]
| {{varies|Various}}
| {{LGPL-lic|Free/open source (LGPL)}}
| GNU C library
| Built-in, outputs accesses
|-
| [[MTuner]]
| {{varies|Various}}
| {{Free}}
| C, C++
| Runtime intercepts, Link-time override (MSVC, Clang and GCC), Leak detection
|-
| ocp-memprof<ref>http://memprof.typerex.org/</ref>
| Linux 64
| Proprietary/open-source
| [[OCaml]]
| Compile-time
|-
| [[Oracle Solaris Studio]] (formerly Sun Studio Runtime Checking)
Line 224 ⟶ 152:
|
|-
| [[OLIVER]] (APT international)
| [[OpenPAT]]<ref>
| MVS, MVS/EXA, DOS/VSE
[http://www.OpenPAT.org "OpenPAT: The Open Performance Analysis Toolkit"]</ref><ref>
| {{Proprietary}} software
[http://www.openpat.org/docs/OpenPAT%20--%20Introduction.pdf "OpenPAT: Analysing Programs the Easy Way"] by Dr Simon Spacey
| IBM Assembler
</ref>
| Runtime intercepts, Hypervisor - Type 2
| Any
| Free (requires registration)
| Any compilable language including C, C++, Java and Fortran
| Compile-time instrumentation, runtime intercepts
|-
| [[Rogue Wave Software|TotalView]]
| softwareverify<ref>http://www.softwareverify.com/memory-leak-detection.php</ref>
| Windows
| Proprietary commercial
| .NET, C, C++, Java, JavaScript, Lua, Python, Ruby, VMs
| Runtime
|-
| [[Splint (programming tool)|Splint]]
| Any
| Free/open source (GPL)
| C
| [[Static program analysis]]
|-
| [[TotalView]]
| Unix, Mac OS X
| {{Proprietary}} commercial
| C, C++, Fortran
| Runtime
|-
| [[{{section link|Valgrind]]|Memcheck}}
| Linux, FreeBSD, Solaris/illumos, Mac OS, Android
| {{GPL-lic|Free/open source (GPL)}}
| {{Any}}
| Runtime intercepts
|-
| Visual Leak Detector<ref>http://vld.codeplex.com/</ref>
| Windows (Visual Studio)
| Free/open source (LGPL)
| C, C++
| Compile-time overrides, leak detection
|-
| [[WinDbg]]
| Windows
| {{Proprietary}} freeware
| C, C++, .NET, Python
| Runtime
|-
| [[D Profiler]]<ref>https://github.com/xwlan/dprofiler</ref>
| Windows
| Free/open source
| C, C++
| Runtime. Support allocation profiling, leak detection. Also support CPU, I/O and lock profiling.
|}
 
==See also==
 
{{Portal|Software Testing}}
*[[Profiling (computer programming)]]
*[[List of performance analysis tools]]
*[[Debugger]]
*[[Runtime error detection]]
*[[Software testing]]
*[[Software engineering]]
Line 287 ⟶ 189:
 
==References==
*Michael C. Daconta: <cite>C++ Pointers and Dynamic Memory Management</cite>, John Wiley & Sons, {{ISBN |0-471-04998-0}}
*[[Andrew Koenig (programmer)|Andrew Koenig]]: <cite>C Traps and Pitfalls</cite>, Addison-Wesley, {{ISBN |0-201-17928-8}}
{{Reflist}}
<references />
 
==External links==
*"[http://www.edm2.com/0508/membug.html Hunting Memory Bugs]" by Ivan Skytte Jørgensen
*"[https://web.archive.org/web/20071212210815/http://www.cs.utexas.edu/users/jpmartin/memCheckers.html Comparison of Free Memory Checkers]" by Jean-Philippe Martin {{CitationFull brokencitation needed|date=September 2009}}
 
{{Memory management navbox}}
 
[[Category:Memory management software]]