<A target="_top" HREF="manual_contents.html"><img align=center src="contents.gif" ALT="Contents"></A> Up Previous Next

Set heap size -h<size>


A -h<size> option can be used to request a particular heap size for the interpreter ---the total number of cells that are available at any one time--- when Hugs is first loaded. The request will only be honoured if it falls within a certain range, which depends on the machine, and the version of Hugs that is used. The <size> parameter may include a K or k suffix, which acts as a multiplier by 1,000. For example, either of the following commands:
 hugs -h25000
 hugs -h25K
will usually start the Hugs interpreter with a heap of 25,000 cells. Cells are generally 8 bytes wide (except on the 16 bit Hugs running on DOS) and Hugs allocates a single heap. Note that the heap is used to hold an intermediate (parsed) form of each module while it is being read, type checked and compiled. It follows that, the larger the module, the larger the heap required to enable that module to be loaded into Hugs. In practice, most large programs are written (and loaded) as a number of separate modules which means that this does not usually cause problems.

Unlike all of the other options described here, the heap size setting cannot be changed from within the interpreter using a :set command. However, on Windows 95/NT, changing the heap size with :set will affect the next running of Hugs since it saves all options in the registry.