Monitor memory usage

DESCRIPTION:

Determines memory allocation by frame and arena.

USAGE:

storageSummary(frame=sys.parent(), by.size=F, print.=T, print.zeros=F)

OPTIONAL ARGUMENTS:

frame
The frame on which to report. Default is sys.parent().
by.size
If T, table arenas by frame number and size, otherwise just by frame number. By default, F.
print.
Print the results and return nothing. This is useful if you call this function from another function. By default, T.
print.zeros
Useful only when using a special debug version of S-PLUS, or sometimes it is used during development. It is used to track particular headers. By default, F.

VALUE:

The headers and arena used in the specified frame.

DETAILS:

Report headers and arena used in various frames. Frames numbered 0 or with positive numbers are evaluation frames. A frame numbered -1 is the session frame. A frame numbered -2 is a special permanent frame. Other negative frame numbers are for databases (in no particular order). NULL or integer(0) means all frames.

REFERENCES:

SEE ALSO:

, ,

EXAMPLES:

tempFun1 <- function(nrow = 10, ncol = 1000) {
        t(sapply(1:nrow, function(i, ncol) {
                old <- storageSummary(NULL, print. = F)
                junk <- rnorm(ncol)
                new <- storageSummary(NULL, print. = F)
                cat("Iteration: ", i, "\n")
                print(cbind(Total = rowSums(new), Diff = rowSums(new - old)))
                cat("\n")
                junk
        }, ncol = ncol))
        invisible()
}
tempFun()