Memory Handling Descriptions

Memory handling descriptions report detailed information about memory allocation, reallocation, and frees. To turn on memory handling descriptions in the ACUCOBOL-GT runtime, simply specify the -m valuefile command-line option. When -m valuefile is specified, description and tracking information is written to the file named by the file argument. Exactly what information is included in the report is determined by the value argument as follows:

If value is odd, a final memory dump, showing all blocks still allocated, is performed.

If (value / 2) is odd, each allocation, reallocation, and free is written to the file.

If (value / 4) is odd, a full memory dump is written for each allocation, reallocation, and free.

For example, if value equals 3, each allocation, reallocation, and free is reported and a final memory dump is performed when the runtime shuts down. This is because value is odd and value / 2 is also odd.

You can also enable memory handling descriptions for any extend product by setting two environment variables prior to product startup: A_MEM_DESC and A_MEM_DESC_FILE.

A_MEM_DESC must be set to value.

A_MEM_DESC_FILE specifies the name of the output file.

Both environment variables must be set to enable memory handling descriptions. Note that these are environment variables, not configuration variables. Also note that when memory descriptions are enabled with environment variables, the output does not (and for technical reasons cannot) include a final memory dump.