In general, Mozart has very few system limitations. Memory allocation is dynamic. The number of record fields, the size of arrays and dictionarys, the number of characters in an atom, the number of threads, integer precision, etc., are all limited only by available memory. Memory is requested from the operating system according to need. The allocation strategy is user-customizable (see Chapter 20 of ``System Modules''). If memory use decreases, then all unused memory is eventually returned to the operating system.
However, a few limits remain.
Mozart has been ported to 32-bit and 64-bit architectures. On the 32-bit architectures, a program can have a maximum of 512MB of active data per site at any instant. This limit is due to the implementations of dynamic typing and garbage collection.
A crude but effective way to go beyond this limit is to use the Remote
module to create new sites (i.e., OS processes). This is especially effective if communication to the new processes is by shared memory. For more information on Remote
, see Chapter 12 of ``System Modules''.
All memory areas of the virtual machine are garbage collected except for the atom table and the table of record arities. In particular, the area used to store program instructions is garbage collected.
We recommend to avoid as much as possible dynamically creating atoms (with String.toAtom
or VirtualString.toAtom
) or records with new arities (for example, with Record.filter
). Tuples do not have entries in the arity table, so they are not subject to this restriction.
Procedures can have no more than 4096 arguments.
The range of a finite domain variable is from 0 to (i.e., 134217726).
The range of a finite set domain variable is from to
.
Integers of 28-bit or less precision are stored in registers. Floating-point numbers and integers needing more than 28-bit precision are stored on the heap.
This means that calculations are significantly faster and memory-efficient when done with small integers rather than with floating-point numbers or big integers.
The compiler is part of the interactive run-time system. It may use large amounts of memory on large programs or programs that access large data structures in the run-time environment. This memory use is temporary. After the compiler completes, the memory is eventually returned to the operating system.
See the distribution tutorial ``Distributed Programming in Mozart - A Tutorial Introduction'' for a list of limitations related to distribution and fault tolerance.