GC: Full Garbage Collection

Description Usage Arguments Value See Also Examples

Description

GC performs garbage collection until free memory indicators show no change.

Usage

1
GC(verbose = getOption("verbose"), reset=FALSE)

Arguments

verbose

[logical]: if TRUE, the garbage collection prints statistics about cons cells and the space allocated for vectors.

reset

[logical]: if TRUE the values for maximum space used are reset to the current values.

Value

GC returns a matrix with rows Ncells (_cons cells_), usually 28 bytes each on 32-bit systems and 56 bytes on 64-bit systems, and Vcells (_vector cells_, 8 bytes each), and columns used and gc trigger, each also interpreted in megabytes (rounded up to the next 0.1Mb).

If maxima have been set for either Ncells or Vcells, a fifth column is printed giving the current limits in Mb (with NA denoting no limit).

The final two columns show the maximum space used since the last call to GC(reset=TRUE) (or since R started).

See Also

The R Internals manual.

Memory on R's memory management, and gctorture if you are an R developer.

reg.finalizer for actions to happen at garbage collection.

Examples

1
2
3
4
GC() #- do it now
x <- integer(100000); for(i in 1:18) x <- c(x,i)
GC(TRUE)
GC(reset=TRUE)

mcanouil/myScriptsMickael documentation built on May 22, 2019, 12:59 p.m.