Rev 56186 | Rev 64998 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/base/man/gctorture.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2007 R Core Team% Distributed under GPL 2 or later\name{gctorture}\title{Torture Garbage Collector}\usage{gctorture(on = TRUE)gctorture2(step, wait = step, inhibit_release = FALSE)}\alias{gctorture}\alias{gctorture2}\arguments{\item{on}{logical; turning it on/off.}\item{step}{integer; run GC every \code{step} allocations; \code{step= 0} turns the GC torture off.}\item{wait}{integer; number of allocations to wait before startingGC torture.}\item{inhibit_release}{logical; do not release free objects forre-use: use with caution.}}\description{Provokes garbage collection on (nearly) every memory allocation.Intended to ferret out memory protection bugs. Also makes \R run\emph{very} slowly, unfortunately.}\details{Calling \code{gctorture(TRUE)} instructs the memory manager to force afull GC on every allocation. \code{gctorture2} provides a more refinedinterface that allows the start of the GC torture to be deferred andalso gives the option of running a GC only every \code{step}allocations.The third argument to \code{gctorture2} is only used if R has beenconfigured with a strict write barrier enabled. When this isthe case all garbage collections are full collections, and the memorymanager marks free nodes and enables checks in many situations thatsignal an error when a free node is used. This can greatly help inisolating unprotected values in C code. It does not detect the casewhere a node becomes free and is reallocated. The\code{inhibit_release} argument can be used to prevent suchreallocation. This will cause memory to grow and should be used withcaution and in conjunction with operating system facilities to monitorand limit process memory use.}\value{Previous value of first argument.}\author{Peter Dalgaard and Luke Tierney}\keyword{environment}