"Fossies" - the Fresh Open Source Software Archive 
Member "mpr-2.8/README" (6 Jun 2005, 3390 Bytes) of package /linux/misc/old/mpr-2.8.tar.gz:
As a special service "Fossies" has tried to format the requested text file into HTML format (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 mpr is a memory allocation profiler for C/C++ programs.
2
3 mpr finds malloc/realloc memory leaks and memory allocation statistics by
4 using a simple, brute force strategy: log all malloc/free calls to a file and
5 post-process this log file when the program terminates.
6
7 mpr keeps track of the entire call chain leading up to a malloc/free call. This
8 is superior to conventional methods that keep track of only the immediate
9 caller using __FILE__ and __LINE__ pre-processor tricks.
10
11 As of version 2.0, you no longer need to re-link your application in order to
12 use mpr. If your program is dynamically linked, using mpr can be as simple as
13 typing 'mpr program ...' (see mpr.html for details).
14
15 --
16
17 To give you an idea of what mpr can do, here are some sample outputs:
18
19 (1) memory allocations grouped by call chains:
20 (col2=number of allocs, col3=amount allocated, col4=percent)
21
22 main(tst.c,52) 55 1760 2.35%
23 foo(bar.c,14):bar(bar.c,28):main(tst.c,59) 200 2000 2.67%
24 main(tst.c,47) 200 3200 4.27%
25 foo(bar.c,19):bar(bar.c,28):main(tst.c,59) 200 4000 5.34%
26 foo(tst.c,34):main(tst.c,58) 200 12800 17.08%
27 foo(baz.c,21):baz(baz.c,29):main(tst.c,60) 200 51200 68.30%
28
29 (2) memory leaks grouped by call chains:
30 (col2=number of allocs leaked, col3=amount leaked, col4=percent)
31
32 main(tst.c,47) 52 832 2.36%
33 foo(bar.c,14):bar(bar.c,28):main(tst.c,59) 88 880 2.50%
34 main(tst.c,52) 31 992 2.82%
35 foo(bar.c,19):bar(bar.c,28):main(tst.c,59) 103 2060 5.85%
36 foo(tst.c,34):main(tst.c,58) 108 6912 19.62%
37 foo(baz.c,21):baz(baz.c,29):main(tst.c,60) 92 23552 66.86%
38
39 (3) memory allocations grouped by size:
40 (col1=size, col2=number of allocs, col3=amount allocated col4=percent)
41
42 32 55 1760 2.35%
43 10 200 2000 2.67%
44 16 200 3200 4.27%
45 20 200 4000 5.34%
46 64 200 12800 17.08%
47 256 200 51200 68.30%
48
49 (4) memory leaks grouped by size:
50 (col1=size, col2=number of allocs leaked, col3=amount leaked, col4=percent)
51
52 16 52 832 2.36%
53 10 88 880 2.50%
54 32 31 992 2.82%
55 20 103 2060 5.85%
56 64 108 6912 19.62%
57 256 92 23552 66.86%
58
59 --
60
61 The currently supported targets are:
62 x86-linux
63 x86-freebsd
64 x86-netbsd
65 sparc-sunos (tested on solaris8 w/gcc only)
66
67 mpr requires GNU GDB in addition to some standard Unix utilities (awk,
68 sed, nm, sort, cut).
69
70 See file LICENSE for terms and conditions under which you may use mpr.
71 See file INSTALL for instructions on how to build and install mpr.
72 See directory doc/ for documentation.
73
74 mpr was designed to be simple and easy to use - please keep it that way.
75
76 Please send all bug reports and suggestions to
77
78 taj.khattra@gmail.com (Taj Khattra)