Control Size Threshold at which Objects Are Memory-Mapped

DESCRIPTION:

Controls the object size which triggers memory-mapping. The default is not to memory-map any files.

USAGE:

mmap.control(threshold=-1)

REQUIRED ARGUMENTS:

threshold
an integer specifying the size, in bytes, at which objects are memory-mapped. The default is .Machine$integer.max.

VALUE:

If threshold is negative (the default), returns the current threshold. Otherwise, returns the previous value of the threshold.

SIDE EFFECTS:

Causes objects of size greater than threshold to be memory-mapped.

DETAILS:

Memory-mapping is a technique that can sometimes make more memory available within your S-PLUS session. It can be particularly effective if you need to access only small parts of large objects; with memory-mapped objects, Spotfire S+ can read the pieces it needs directly from the file. However, TIBCO's experience with memory-mapping indicates it is not always useful, and can cause difficulties, so we have set the threshold to prevent automatic memory-mapping.

There are a limited number of files that can be memory-mapped per process, the limit depending upon the operating system. Regardless of the value of mmap.control, S-PLUS uses memory-mapped files for loading the standard S-PLUS libraries in the search list, 2 per library.

There should be no problems accessing S objects associated with a memory-mapped file, and these files are very efficient for read-only purposes. Problems may arise, however, if your S-PLUS functions or scripts try to modify objects which are memory-mapped.

Memory-mapping of binary S-PLUS objects is experimental and subject to change in future versions of S-PLUS.

SEE ALSO:

EXAMPLES:

# Set memory-mapping threshold to 50000
mmap.control(50000)