<<<<<<<<<<<<<<<<<

Memdbg(prog-tools) Programming Tools Memdbg(prog-tools)

NAME

memdbg - inquire about and control reference count memory manager

DESCRIPTION

The memdbg class allows the user to interrogate the reference count memory manager used in LYMB. Some control over memory release policies is available, but is of dubious value. The memdbg class should not be instantiated.

SUPERCLASS

object

INSTANCE VARIABLES

None.

MESSAGES

debugon! Enable verbose tracing of memory manager actions.

debugon: object Enable tracing of memory manager actions for object .

debugoff! Disable verbose tracing of memory manager actions.

debugoff: object Disable tracing of memory manager actions for object .

print! Print information about currently active (tracked) memory. If debugon! has been sent to memdbg, all tracked objects will be printed. Otherwise, only that objects given as the argument to a debugon: message will be printed.

allocation=number sets a factor by which all memory requests are multiplied before being passed on to malloc/realloc/calloc. Some measure of diagnostic ability is available by increasing actual memory allocation sizes when memory is potentially being overwritten by errant code. By setting the allocation factor to something larger than 1.0, "buffer zones" at the end of requested memory are established. The default is 1.0.

allocation? returns the current allocation factor.

malloc_stats? returns a 30-element integer array on the stack. The i-th element represents the number of 2^(i+3)

length blocks allocated. This is only available if GNU malloc is being used and LYMB was built with -DMSTATS.

memory_free? returns the number of bytes on the free list. (This is different than - and generally much smaller than - the amount of free virtual memory.) This is only available if GNU malloc is being used and LYMB was built with -DMSTATS.

memory_used? returns the number of bytes allocated using malloc. This is only available if GNU malloc is being used and LYMB was built with -DMSTATS.

EXAMPLES

The following LYMB script

memdbg debugon:arrow_data; idraw_data new: arrow_data filename="arrow.ps" initialize!; memdbg print!;

generates the following output:

mem_malloc: Ptr 0x265488 allocated by arrow_data. mem_malloc: Ptr 0x281c68 allocated by arrow_data. .... mem_realloc: mem_realloc returned same ptr 0x2dae88 .... mem_malloc: Ptr 0x281548 allocated by arrow_data.

ptr size refs refs by value ---------- ---------- ---- --------------- --------------- 0x002dae88 60 1 arrow_data 4L?????M??... 0x00281548 40 1 arrow_data ??????????... 0x00265488 72 1 arrow_data ?????-.???...


Please send comments and suggestions to
consult@rpi.edu