NAME
|
leak, kmem, umem – help find memory leaks |
SYNOPSIS
|
leak [ –abcds ] [ –f binary ] [ –r res ] [ –x width ] pid ...
|
DESCRIPTION
|
Leak examines the named processes, which should be sharing their
data and bss segments, for memory leaks. It uses a mark and sweep–style
algorithm to determine which allocated blocks are no longer reachable
from the set of root pointers. The set of root pointers is created
by looking through the shared bss
segment as well as each process's registers.
dark blue Completely allocated. bright blueContains malloc headers. bright red Contains malloc headers for leaked memory. dark red Contains leaked memory. yellow Completely free white Padding to fill out the image. The bright pixels representing headers help in counting the number of blocks. Magnifying the images with lens(1) is often useful. |
EXAMPLES
List lost blocks in 8.out. This depends on the fact that there
is only once instance of 8.out running; if there were more, the
output of leak –s 8.out would need editing before sending to the
shell.
|
SOURCE
|
/sys/lib/acid/leak /sys/src/cmd/aux/acidleak.c /rc/bin/leak /rc/bin/kmem /rc/bin/umem |
SEE ALSO
|
getcallerpc(2), setmalloctag in malloc(2), rdbfs(4) |
BUGS
|
Leak and kmem depend on the internal structure of the libc pool
memory allocator (see pool(2)). Since the ANSI/POSIX environment
uses a different allocator, leak will not work on APE programs.
|