This section describes the various system parameters required to run Prolog.
There is normally no need for you to seek any special privileges or quotas in order to run Prolog. Prolog will automatically expand its space up to the total amount of virtual space you are allowed. If it should run out of space, Prolog will raise a resource error.
This may happen because of an infinite recursion in your program, or it may
be that your program really needs more space than is available.
Under UNIX, if you are using the C shell (
csh), you can find out how much space
is available by means of the
limit. The command
will list a number of limits of which the relevant one is
number is the number of kilobytes available to Prolog for its data areas.
You can reduce this limit by typing, for example,
% limit datasize 2000
The main reason that you might want to reduce the limit is that some systems allow the allocation of more virtual memory than there is swap space available, and then to crash. You can run quite large programs with a datasize of 2000 kilobytes.
On some UNIX systems, the specified
datasize(program) limit (see
getrlimit(3)) can be grossly higher then the maximum break that a process can set. This is because the setting of the break is dependent upon the amount of swap space available. Since all processes share the same swap space, the space available to any one process is based on the space usage of all other processes running on the machine. Therefore, one process that has set a large program break may prevent another process from doing the same, if both are running simultaneously.
The Quintus Prolog memory manager makes calculations based upon the
datasize limit, since the actual limit cannot be
determined except by experimentation, and even then the limit changes
over time. Better memory management will result when the
datasize limit is close to the actual limit.
The default behavior of Prolog is tuned to be optimal for a large
class of programs. If the programmers need greater control of the way
Prolog grows and frees memory, they can set environment variables, the
documentation for which follow. Note that the default values for these
variables should satisfy almost all programs and you really do not
need to set these variables at all.
The values for these variables are entered in bytes, but may be
M meaning kilobytes or megabytes respectively.
By default, the value is the minimum memory required for
Prolog to start up. In addition, the value is constrained to be
at least that amount, regardless of the user setting.
limit can also be used to set the amount of data space
that can be used by the the current shell and all processes within it.
By default, the value is effectively infinity, which is to say
that Prolog's expansion will only be limited by the space that the
shell is able to provide it.
By default, the value is the minimum amount of memory that
will allow Prolog to expand one of its data areas, by kilobytes. In
addition, the value is constrained to be at least that amount,
regardless of the user setting.