AminetAminet
Search:
82919 packages online
- About
- Recent
- Browse
- Search
- Upload
- Setup
- Services

dev/debug/MemLog.lha

Mirror:Random
Showing:m68k-amigaosppc-amigaosppc-morphosi386-arosi386-amithlonppc-warpupppc-powerupgeneric
No screenshot available
Short:trace unmatched allocs - find mem leaks
Author:thorfdbg at alumni.tu-berlin.de (Thomas Richter)
Uploader:thorfdbg alumni tu-berlin de (Thomas Richter)
Type:dev/debug
Version:1.00
Architecture:m68k-amigaos >= 2.0.4
Date:2020-02-14
Download:http://aminet.net/dev/debug/MemLog.lha - View contents
Readme:http://aminet.net/dev/debug/MemLog.readme
Downloads:100
-----------------------------------------------------------------------------

New in V1.00:	This is the first Aminet release

-----------------------------------------------------------------------------

What is the purpose of this utility:

This utility helps to identify memory leaks in programs and the
AmigaOs operating system. To this end, it logs all allocations made
by a specific task or a specific ROM module, and upon exit, prints
where the allocations have been made. If the SegTracker utility is
installed as well, this allows the identification of the hunk and
offset from where memory was allocated. This may then be used to
find, within the source, the origin of the allocation, hopefully allowing
to hunt down why the allocated memory was not released.

Note that AmigaOs may pass memory from one task to another, i.e. this
utility may report false positives of memory that is allocated by the
supervised task, but is to be released by some other mechanism outside
the original task, and that the Os also pools memory itself in some
of its libraries - e.g. graphics and layers pool some of their structures.

-----------------------------------------------------------------------------

Usage:

Ideally, this program should be used together with SegTracker, and
the "Avail" program from the system. To start logging, first install
SegTracker, then run

1.SYS:> Avail Flush

from the shell to release temporary memory. Next, run this utility.

1.SYS:> MemLog TASK myprogram

This will record all allocations made by a program "myprogram". The
program name is either the name of the task, or the name of a shell
program run as a shell process.

Next, run in a second shell, or from the workbench, the program to
debug:

2.SYS:> myprogram

Use "myprogram" now as you would always do, e.g. click on its GUI,
enter data, etc... then stop it. After quitting the program,
flush temporary memory again:

2.SYS:> Avail Flush

Close the second shell window, go now back to the first shell window,
and abort "MemLog" with ^C (i.e. press Control + C). At this point,
MemLog will print, on the shell, the memory segments that have not
been released yet, but that have been allocated by your program, along
with a stack traceback where the call came from, along with SegTracker
information on the hunk and offset where the specific function call is
within the program.

Alternatively, "MemLog" may also be used to observe allocations from
a specific ROM module only, by running it as such:

1.SYS:> MemLog MODULE dos.library

This will log all allocations that come, one way or another, from the
dos.library and functions within the dos.library, or, to trace allocations
coming from a task, within a specific ROM module:

1.SYS:> MemLog TASK myprogram MODULE dos.library

------------------------------------------------------------------------------

                         The THOR-Software Licence (v2, 24th June 1998)


This License applies to the computer programs known as the "MemLog" 
and its sources. The "Program", below, refers to such program. The
"Archive" refers to the package of distribution, as prepared by the author
of the Program, Thomas Richter. Each licensee is addressed as "you".



The Program and the data in the archive are freely distributable
under the restrictions stated below, but are also Copyright (c)
Thomas Richter.

Distribution of the Program, the Archive and the data in the Archive by a
commercial organization without written permission from the author to any
third party is prohibited if any payment is made in connection with such
distribution, whether directly (as in payment for a copy of the Program) or
indirectly (as in payment for some service related to the Program, or
payment for some product or service that includes a copy of the Program
"without charge"; these are only examples, and not an exhaustive enumeration
of prohibited activities).


However, the following methods of distribution
involving payment shall not in and of themselves be a violation of this
restriction:


(i) Posting the Program on a public access information storage and
retrieval service for which a fee is received for retrieving information
(such as an on-line service), provided that the fee is not
content-dependent (i.e., the fee would be the same for retrieving the same
volume of information consisting of random data).


(ii) Distributing the Program on a CD-ROM, provided that

a) the Archive is reproduced entirely and verbatim on such CD-ROM, including
especially this licence agreement;

b) the CD-ROM is made available to the public for a nominal fee only,

c) a copy of the CD is made available to the author for free except for
shipment costs, and

d) provided further that all information on such CD-ROM is redistributable
for non-commercial purposes without charge.


Redistribution of a modified version of the Archive, the Program or the
contents of the Archive is prohibited in any way, by any organization,
regardless whether commercial or non-commercial. Everything must be kept
together, in original and unmodified form.




Limitations.


THE PROGRAM IS PROVIDED TO YOU "AS IS", WITHOUT WARRANTY. THERE IS NO
WARRANTY FOR THE PROGRAM, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE
RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD
THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
SERVICING, REPAIR OR CORRECTION.


IF YOU DO NOT ACCEPT THIS LICENCE, YOU MUST DELETE THE PROGRAM, THE ARCHIVE
AND ALL DATA OF THIS ARCHIVE FROM YOUR STORAGE SYSTEM. YOU ACCEPT THIS
LICENCE BY USING OR REDISTRIBUTING THE PROGRAM.


                                                        Thomas Richter

-----------------------------------------------------------------------------

So long,
	Thomas			(February 2020)


Contents of dev/debug/MemLog.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[Amiga]                   1013    1436  70.5% -lh5- cf79 Feb 14 16:24 MemLog
[Amiga]                   2654    6239  42.5% -lh5- 1c76 Feb 14 16:40 MemLog.readme
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total         2 files    3667    7675  47.8%            Feb 14 20:16

Aminet © 1992-2020 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>