Several tools help you track, test, and debug memory in
extend products, including the runtime and linked C programs. These facilities are particularly helpful when ACUCOBOL-GT programs
interface frequently with C programs.
All products have the ability to monitor, test, and debug memory allocations in three ways. They can:
- Track memory boundaries, so that if any boundaries are corrupted a report is generated. This facility is called memory bounds
- Track how much memory is allocated in each of six subsystems. This facility is referred to as memory tracking.
- Output a description of each memory allocation, reallocation, and release by file and line. Each action can also include a
programmed text message. This facility is called memory handling descriptions.
These facilities are described in detail in
Memory Testing and Error Handling. How these facilities are accessed via C is described in the following sections.
The memory allocation features can be turned on and off using the appropriate runtime options (described in Memory Testing and Error Handling
), and the available monitoring, testing, and debugging features are determined by the state of the parallel runtime option.
For example, when boundary checking is turned off, memory boundaries are not set and executing dbg_test() does not test the
boundaries of blocks allocated. Similarly, turning off memory tracking will stop keeping track of newly allocated memory,
and the numbers reported will not reflect blocks allocated while the feature is off.