R/stubborngc.R

Defines functions stubborngc

Documented in stubborngc

#' Repeat garbage-collecting until all resource is freed
#' 
#' stubborngc repeats collecting garbage untill no more resource can be freed
#' 
#' 
#' @param verbose Logical, verbose or not
#' @param reset Logical, reset or not.
#' @return Side effect is used.
#' @author Jitao David Zhang <jitao_david.zhang@@roche.com>
#' @seealso \code{\link{gc}}
#' @examples
#' 
#' stubborngc()
#' 
#' @export stubborngc
stubborngc <- function(verbose=FALSE, reset=TRUE) {
  .local <- function() gc(verbose=verbose, reset=reset)[2,3]
  gct <- .local()
  while(gct!=.local()) {
    gct <- .local()
  }
}

Try the ribiosUtils package in your browser

Any scripts or data that you put into this service are public.

ribiosUtils documentation built on March 13, 2020, 2:54 a.m.