Total Memory Used by Running S-PLUS

DESCRIPTION:
Returns the number of bytes currently being used by S-PLUS.

USAGE:
memory.size(maximum=F)

OPTIONAL ARGUMENTS:
maximum:
logical. If FALSE, give the current size of the data space; if TRUE, give the maximum size of the data space during the current session.

VALUE:
The size (in bytes) of the data space used by your current invocation of S-PLUS.

DETAILS:
On most machines S-PLUS will shrink its data space when its requirements decrease. On some machines, notably the IBM RS/6000, it cannot shrink the data space so memory.size() will return the same answer regardless of the value of maximum. If it is able to shrink the data space, it will try to shrink it at the end of each top level expression.

The size returned is the size of the space used for dynamically allocated memory. It does not include the space used for the executable code or compiled in data, which totals about 3 megabytes on most machines.

If the total amount of space used by S-PLUS is larger than your available main memory, S-PLUS will dramatically slow down as it spends most of its time transferring the excess to and from the swap disk. (You may need to quit from S-PLUS and restart in order to avoid this.)


SEE ALSO:
allocated , storage , object.size , options .

EXAMPLES:
  memory.size()
[1] 428152
  { sum(log(1:1e5)) ; memory.size() }
[1] 2033784
# grew from 0.4 to 2 megabytes
  memory.size()
[1] 828208
# shrank to 0.8 megabytes
  memory.size(max=T)
[1] 2033784