~bkerensa/ubuntu/raring/valgrind/merge-from-deb

« back to all changes in this revision

Viewing changes to exp-omega/docs/o-manual.xml

  • Committer: Bazaar Package Importer
  • Author(s): Andrés Roldán
  • Date: 2008-06-13 02:31:40 UTC
  • mto: (1.4.1 upstream) (2.2.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: james.westby@ubuntu.com-20080613023140-iwk33rz9rhvfkr96
Import upstream version 3.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?> <!-- -*- sgml -*- -->
 
2
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
 
3
  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
 
4
 
 
5
<chapter id="o-manual" xreflabel="Omega">
 
6
 
 
7
<title>Omega: an instant memory leak detector</title>
 
8
 
 
9
<para>Omega is a Valgrind tool that traces pointers to memory
 
10
      allocations and produces debug output as the last reference
 
11
      is removed to a block that has not been de-allocated.</para>
 
12
 
 
13
<para>Omega works by tracking pointers with the use of p-bits.
 
14
      In similar fashion to the methods used by memcheck and
 
15
      addrcheck, each memory location is flagged by a p-bit which
 
16
      indicates if the location is holding a pointer to an allocated
 
17
      block. Since pointers are multibyte, we gain by only requiring
 
18
      a single p-bit per pointer thus needing one p-bit per 4 bytes
 
19
      on 32bit machines and one p-bit per 8 bytes on 64bit
 
20
      architectures.</para>
 
21
 
 
22
<para>Whilst this simplifies and reduces the memory footprint of
 
23
      one aspect of the tracking methodology, the other aspect can be
 
24
      a bit of a memory hog. As each block is allocated, we need to
 
25
      maintain data about the block and hold back-references to any
 
26
      live pointers. There are various ways of doing this and as the
 
27
      tool evolves further upon its release, doubtless you will all
 
28
      improve upon it (and that's why I love open source).</para>
 
29
 
 
30
<para>This tool has been checked against the simple test cases in
 
31
      the tests directory. Again, you will all have many more that
 
32
      can be added.</para>
 
33
 
 
34
<para>Note that in order to reduce the overheads that this tool
 
35
      incurs, it is assumed that the only problems left are memory
 
36
      leaks. This assumption allows many corner cases to be left
 
37
      un-coded. As we stumble upon those that cannot be avoided,
 
38
      they can be added. A major assumption in the tracking is
 
39
      that all pointers are aligned in memory. If this one fails,
 
40
      the tracking code will have to be re-jigged.</para>
 
41
 
 
42
<para>Bryan "Brain Murders" Meredith, 2006</para>
 
43
 
 
44
</chapter>