Problem:
When an ACUCOBOL-GT runtime terminates, all dynamically allocated memory is released. There are two situations where this is not true: CALL PROGRAM "program" using and CHAIN "program" using .......
A second area which can cause problems is the situation where a subroutine is called several times, and each time it allocates memory by one or more of the above means. If prior to the EXIT PROGRAM you have not DESTROYED these items, then when the subroutine is called again, you end up reallocating this memory. Note that even if the subroutine is CANCELLED, the memory for these items is NOT freed. This causes a "memory leak" where the program starts using up memory. Again, we have found that sometimes this can cause "Illegal Operation" errors or other unexpected results.
Resolution:
These are important considerations when programming with ACUCOBOL-GT. One way of determining whether or not a "memory leak" is occurring is to use the "U" option in debugger. Place a breakpoint just before the EXIT PROGRAM in a subroutine and each time you reach it enter "U". The amount of memory being used should be approximately the same each time. If you see it increasing then you have a memory leak someplace in that routine and the code should be examined for the above mentioned causes.