mleak - locates memory leaks in an mpatrol log file
command is used to display all unfreed memory allocations from
a log file produced by the mpatrol library. This should be used if the mpatrol
library could not finish writing the log file due to abnormal program
termination (which would prevent the SHOWUNFREED
option from working),
but note that some of the unfreed allocations might have been freed if the
program had terminated successfully.
command scans through an mpatrol log file looking for lines
beginning with ALLOC:
but ignores lines beginning with
, so only the LOGALLOCS
necessary when running a program linked with the mpatrol library. Note that as
a result of this, no attempt is made to account for resizing of memory
allocations and so the total amount of memory used by the resulting unfreed
allocations may not be entirely accurate.
This command will also read the unfreed allocations table produced by the
option in the log file if one is present. The entries in
the table will be compared with the currently allocated entries and will be
added if not already present.
argument must be a valid mpatrol log filename but if file
is omitted then mleak
will use mpatrol.log
as the name of the
log file to use. The mleak
command makes two passes over the log file
so the file must be randomly-accessable. If file
is given as -
then the standard input file stream will be used as the log file.
- --help [-h]
- Displays a quick-reference option summary.
- --ignore [-i]
- Specifies that the list of unfreed allocations in the log file should be
- --max-stack depth [-n]
- Specifies the maximum stack depth to display for each unfreed memory
allocation. If depth is 0 then the call stack depth will be
unlimited in size. The default call stack depth is 0.
- --version [-V]
- Displays the version number of the mleak command.
The mpatrol manual and reference card.
Graeme S. Roy <firstname.lastname@example.org>
Copyright (C) 1997-2002 Graeme S. Roy <email@example.com>
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Library General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
This library is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU Library General Public License for more
You should have received a copy of the GNU Library General Public License along
with this library; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307, USA.