Please enable JavaScript to view this site.

A-Shell Reference

When an SBX routine is called, A-Shell ensures that it has available to it, at a minimum, the amount of memory declared in the second argument to the MEMORY statement in miame.ini. (If not specified, the default value is 360K.) If the amount of free memory in the current partition (this is the amount that the function mem(0) would display) is sufficient, the SBX takes over all of that free memory in the parent job. Otherwise, a new, temporary partition is allocated using the minimum size.

Note that when SBX calls are nested, the amount of memory used up in each level is only the amount actually needed, not the full minimum as specified by the MEMORY statement. So, for example, if miame.ini has MEMORY=1000K,500K and you call a series of small nested subroutines, you may be able to stack them many levels deep (as opposed to just 2 levels as implied by the ratio of 1000K to 500K). However, once the amount of free memory in the main partition falls below the minimum (500K in this case), then each nested SBX call after that will allocate a separate 500K temporary partition which is freed up when the SBX returns.