MEMORY=<workmem size>{,sbxmem size{,cachelimit}}
Examples: MEMORY=700K
MEMORY=700K,200K
MEMORY=2M,400K,500K
MEMORY configures certain memory allocation sizes used by each A-Shell user.
The first number specifies the size of the BASIC work area. If no MEMORY statement is specified, the default work area size is 512K. This work area is used for a variety of purposes, including variable storage, the CALL/RETURN stack, allocation of dynamic arrays, string stack, and if sufficient in size, for sorting files, and compiling, and editing programs.
The AlphaBASIC mem() function displays the amount of free memory available in the main work area. Note, however, that as of A-Shell 4.7, the program itself (and any modules loaded by the LOAD command) is stored in dynamically allocated memory outside of the BASIC work area.
The second parameter specifies the amount of memory to be provided for any SBX subroutine call. If not specified, the default is 384K. In either case, if the main work area has sufficient free space at the time of the XCALL, then that will be used instead. (So if you call a lot of SBX routines, it might be more efficient to make your main work area large enough to accommodate the needs of your largest SBX.)
The last parameter specifies the maximum amount of memory to be set aside for caching of SBX subroutines and other modules that are automatically loaded on demand. The default is 200K. Such modules are kept in memory for a period of about 10 minutes after their last access, or until the specified limit is exceeded. At that point, modules are discarded on a LRU (least recently used) basis.
Notes
A number of A-Shell operations that require additional memory, such as BASORT, COMPIL, and VUE, may take the liberty of allocating it outside of the BASIC work area. See the MALLOCLIMIT statement for details on limiting those allocations.
The minimum practical amount of memory to execute many of the LIT commands is now about 350K.
You can also specify the memory size on the A-Shell command line.