|
Apache HTTP Server Version 2.0 ![]() Debugging Memory Allocation in APRThe allocation mechanism's within APR have a number of debugging modes that can be used to assist in finding memory problems. This document describes the modes available and gives instructions on activating them. Available debugging optionsAllocation Debugging - ALLOC_DEBUGDebugging support: Define this to enable code which
helps detect re-use of
free()d memory and other such
nonsense.The theory is simple. The Malloc Support - ALLOC_USE_MALLOCIf defined all allocations will be done with
malloc() and free()d appropriately at the
end.This is intended to be used with something like Electric
Fence or Purify to help detect memory problems. Note that if
you're using efence then you should also add in Pool Debugging - POOL_DEBUGThis is intended to detect cases where the wrong pool is
used when assigning data to an object in another pool.
In particular, it causes the Table Debugging - MAKE_TABLE_PROFILEProvide diagnostic information about make_table() calls
which are possibly too small.
This requires a recent gcc which supports
Use Allocation Statistics - ALLOC_STATSProvide some statistics on the cost of allocations.
This requires a bit of an understanding of how alloc.c works. Allowable CombinationsNot all the options outlined above can be activated at the same time. the following table gives more information.
Additionally the debugging options are not suitable for multi-threaded versions of the server. When trying to debug with these options the server should be started in single process mode. Activating Debugging OptionsThe various options for debugging memory are now enabled in
the
To enable allocation debugging simply move the NoteIn order to use the various options the server must be rebuilt after editing the header file. |
|
This apache manual Copyright © 1999-2003, The Apache Software Foundation.
Web Design Copyright © 1999-2003. Chrisranjana Software Solutions Pvt Ltd. syndicate rss feed |