The default amount of memory available to these subroutines is 360K, but this figure may be changed using the MEMORY statement in the System Configuration file. If the current memory partition has sufficient room, the SBX will use that memory like subroutines do under AMOS. Otherwise, a new, temporary partition will be allocated.
Although memory allocation is fast, if you are concerned about minimizing SBX calling overhead, you would be advised to make the main memory partition large enough so that the SBX memory can be taken from it. For example, if your SBX routines can get by with 360K, and your largest RUN program requires 400K of working memory, then if you set your memory partition size to more than 760K, the SBX routine will be able to share the same memory allocation with the calling program. (Of course, nesting SBX calls would require successively larger partitions to avoid the automatic temporary memory allocations.) To determine how much free memory is available, use the mem(0) function within a running program. To trace memory allocations in the ashlog.log file, use SET TRACE MALLOC ON before running your program.