Node:Memory Considerations, Next:, Previous:Multiple SICStus Run-Times, Up:Multiple SICStus Run-Times



Memory Considerations

The most pressing restriction when using more than one SICStus run-time in a process is that (on 32bit machines) all these run-times must compete for the lower 256MB of memory. This is worsened by the fact that each SICStus run-time will attempt to grow its memory area as needed, leading to fragmentation. A fix that removes the restriction on useable memory is planned for a later release.

One way to avoid the fragmentation issue to some extent is to make each SICStus run-time preallocate a large enough memory area so it will not have to grow during run-time. This can be effected by setting the environment variables GLOBALSTKSIZE and PROLOGINITSIZE.

bash> GLOBALSTKSIZE=10MB; export GLOBALSTKSIZE;
bash> PROLOGINITSIZE=20MB; export PROLOGINITSIZE;

You can use statistics/2 to try to determine suitable values for thes, but it is bound to be a trial-and-error process.