Panggilan gc menyebabkan pengumpulan sampah terjadi. gcinfo menyetel tanda sehingga pengumpulan otomatis tidak bersuara (verbose = FALSE) atau mencetak statistik penggunaan memori (verbose = TRUE).
gc(verbose = getOption("verbose"), reset = FALSE, full = TRUE)
gcinfo(verbose)
| Parameter | Deskripsi |
|---|---|
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. |
full |
logical; if TRUE a full collection is performed; otherwise only more recently allocated objects may be collected. |
# NOT RUN {
gc() #- do it now
gcinfo(TRUE) #-- in the future, show when R does it
x <- integer(100000); for(i in 1:18) x <- c(x, i)
gcinfo(verbose = FALSE) #-- don't show it anymore
gc(TRUE)
gc(reset = TRUE)
# }