|
NAMEMemGuard —
memory allocator for debugging purposes
SYNOPSISoptions DEBUG_MEMGUARD
DESCRIPTIONMemGuard is a simple and small replacement memory
allocator designed to help detect tamper-after-free scenarios. These problems
are more and more common and likely with multithreaded kernels where race
conditions are more prevalent.
EXAMPLESTo useMemGuard for a memory type, either add an entry
to /boot/loader.conf:
vm.memguard.desc=<memory_type> Or set the vm.memguard.desc sysctl(8) variable at run-time: sysctl vm.memguard.desc=<memory_type> Where memory_type can be either a short description of the memory type to monitor, either name of uma(9) zone. Only allocations from that memory_type made after vm.memguard.desc is set will potentially be guarded. If vm.memguard.desc is modified at run-time then only allocations of the new memory_type will potentially be guarded once the sysctl(8) is set. Existing guarded allocations will still be properly released by either free(9) or uma_zfree(9), depending on what kind of allocation was taken over. To determine short description of a
malloc(9)
type one can either take it from the first column of
vmstat(8)
The vm.memguard.divisor boot-time tunable is
used to scale how much of the system's physical memory
SEE ALSOsysctl(8), vmstat(8), contigmalloc(9), malloc(9), redzone(9), uma(9)HISTORYMemGuard first appeared in FreeBSD
6.0.
AUTHORSMemGuard was originally written by
Bosko Milekic
<bmilekic@FreeBSD.org>.
This manual page was originally written by Christian
Brueffer
<brueffer@FreeBSD.org>.
Additions have been made by Matthew Fleming
<mdf@FreeBSD.org> and
Gleb Smirnoff
<glebius@FreeBSD.org>
to both the implementation and the documentation.
Visit the GSP FreeBSD Man Page Interface. |