Memcheck - Memory Checker
This is the source distribution of memcheck, Memory Allocation Checker.
To find out what's new in memcheck, see the file `NEWS'.
To find out how to build memcheck, consult the file `INSTALL'.
- For further information, consult the following files:
- AUTHORS List of contributing authors.
- COPYING The memcheck license.
- INSTALL How to build and install memcheck.
- NEWS Release information and recent changes.
- README This file.
- Fault on pointer overrun (read or write).
- Fault on freed pointer dereference (read or write).
- Log double free or realloc of already freed pointer.
- Log memory not freed on exit.
- Check for pointer underrun on free/realloc.
- Set level of logging.
- Optionally reverse behaviour of overrun and underrun.
- Optionally "churn" reallocations. Always return a different pointer.
- Optionally log pointer overruns instead of faulting.
- Optionally return freed memory to system.
(May hurt checking for freed pointer usage).
- Optionally log "large" allocations.
- Optionally run out-of-memory after a specified amount of memory has been used.
- Very small performance impact.
- Large memory footprint impact.
- Hal Duston firstname.lastname@example.org
- make check
- make install
- On systems using GCC, bash, glibc:
- For source compilation, you can add `-include memcheck.h' to CPPFLAGS.
- For binaries, you can add `libmemcheck.so' to LD_PRELOAD
- On other systems:
You will need to recompile after adding #include "memcheck.h" to the source,
and `-lmemcheck' to LDFLAGS.
- MEMCHECK environment variable:
- comma seperated values place in the MEMCHECK environment variable.
- options with values are set with an `=' equal sign.
- underruns: set to trap on underruns instead of overruns.
- reuse: set to reuse freed memory in later allocations.
- churn: set to return a different pointer on every realloc.
- set to `r' to retry after setting page as read-only.
- set to `w' to retry after setting page as read/write.
- available on systems providing the faulting data
- address to the signal hander.
- set to provide a backtrace in the logfile
- available on glibc systems.
- set to `e' to only log "errors".
- set to `w' to also log "warnings".
- set to `i' to also log "informational".
- large: set to `n' to log allocations larger than `n' bytes.
- limit: set to `n' to limit total memory usage to `n' bytes.
`k', `K', `m', `M', and `g', `G' may be used as multipliers.
- Supported platforms:
- ia64-hp-hpux11.23 (*)
- sparc64-unknown-linux-gnu (*)
- (*) Faulting data address not provided to the signal handler.
restart won't work, and the address isn't logged.
- (**) libtool has some kind of incompatibility with hpux.
It can't seem to build shared libraries with either gcc or cc.