From: taj@wimsey.com (Taj Khattra)
Subject: mpr-1.2 - a poor man's memory profiler
Date: 1996/09/11 [thread overview]
Message-ID: <cola-liw-842460362-1458-0@liw.clinet.fi> (raw)
-----BEGIN PGP SIGNED MESSAGE-----
I have uploaded mpr-1.2 to sunsite.unc.edu:/pub/Linux/Incoming/mpr-1.2.tar.gz.
It should move to directory /pub/Linux/devel/lang/c soon.
Here are some excerpts from README:
This is version 1.2 of mpr, a poor man's memory profiling package for
Unix/C programs. It is inspired by Benjamin Zorn's memory profiler mprof.
mpr can be used to find malloc/realloc memory leaks and memory allocation
statistics and patterns - it does not find memory corruption errors.
The basic strategy is to log all memory alloc/free requests to a log file
and then post-process this log file once the program has terminated.
mpr keeps track of the entire call chain leading up to a memory
alloc/free request, making it much easier to find memory allocation
problems. This is superior to conventional methods of keeping track of
only the immediate caller of a memory alloc/free routine using, e.g.,
__FILE__ and __LINE__.
To give you an idea of what mpr can do, here are some sample outputs for
the example program that is included with mpr-1.2.
memory allocations grouped by call chains:
(column2=number of allocs, column3=amount allocated)
main(tst.c,58) 45 1440
foo(bar.c,14):bar(bar.c,28):main(tst.c,65) 200 2000
main(tst.c,53) 200 3200
foo(bar.c,19):bar(bar.c,28):main(tst.c,65) 200 4000
foo(tst.c,36):main(tst.c,64) 200 12800
foo(baz.c,21):baz(baz.c,29):main(tst.c,66) 200 51200
memory leaks grouped by call chains:
(column2=number of allocs leaked, column3=amount leaked)
main(tst.c,58) 21 672
main(tst.c,53) 45 720
foo(bar.c,14):bar(bar.c,28):main(tst.c,65) 92 920
foo(bar.c,19):bar(bar.c,28):main(tst.c,65) 101 2020
foo(tst.c,36):main(tst.c,64) 94 6016
foo(baz.c,21):baz(baz.c,29):main(tst.c,66) 108 27648
memory allocations grouped by size:
(column1=size, column2=number of allocs)
10 200
16 200
20 200
32 45
64 200
256 200
memory leaks grouped by size:
(column1=size, column2=number of allocs leaked)
10 92
16 45
20 101
32 21
64 94
256 108
Here is a summary of changes from previous versions:
1.2
- config/{mprpc, mprnm}.linux: added support for linux elf. Courtesy
of Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>.
- config/mprpc.sco: added support for sco5 elf
- config/btx86.c:btinit(): don't get too chummy with the compiler
1.1
- renamed package from mp to mpr (mp is the name of an existing Unix
based Postscript pretty printer program)
- mp: renamed to mpr
- mprhi: added options -c (call chain length), -b (block size)
and -w (display width). Option -c was suggested by Paul Hicks
<paulh@euristix.ie>.
- mprfn: renamed to mprcc
- mprcc: added options -c (call chain length) and -w (display width)
- mpr.doc: added documentation
Here is the LSM entry:
Begin3
Title: mpr - a poor man's memory profiler for Unix/C programs
Version: 1.2
Entered-date: 11SEP96
Description: mpr can be used to find malloc/realloc memory leaks and
memory allocation statistics and patterns - it does not
find memory corruption errors.
Keywords: memory leak, memory profile, malloc
Author: taj@wimsey.com (Taj Khattra)
Maintained-by:
Primary-site: sunsite.unc.edu /pub/Linux/devel/lang/c
52949 mpr-1.2.tar.gz
612 mpr-1.2.lsm
Alternate-site:
Original-site:
Platforms: x86-linux, x86-sco, vax-ultrix
Copying-policy: almost public domain
End
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2i
iQCVAwUBMjbsVoQRll5MupLRAQHhFAQAgm/at3DXY4s+hxKicM9XGX5rk4P0+Ox/
PhSPV/f8++x6fg82DX5C++7E7K7bJwIxHaiReYBPP/UEGbezhDVKyUGWt/lMYgqF
GJO6s7avLG6No3DjVU7IWDu4tFKf4Ck7ipeNx9EkRwvrzRWcdWdmCwgfUPfO1Rd9
tklY+DI+ZcU=
=aEnz
-----END PGP SIGNATURE-----
--
This article has been digitally signed by the moderator, using PGP.
Finger wirzeniu@kruuna.helsinki.fi for PGP key needed for validating signature.
Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov
PLEASE remember a short description of the software and the LOCATION.
reply other threads:[~1996-09-11 4:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox