gctorture
Force frequent garbage collections
Description
Helps detect memory allocation problems earlier by running frequent garbage collections.
Usage
gctorture(on = TRUE)
gctorture2(step, wait = step, inhibit_release = FALSE)
Arguments
on |
a logical value with a default of TRUE. It can be a value that can be coerced to logical.
|
Details
- If on is set to NA or NULL, then the gctorture setting does not change. (It is used to query for the current value).
- If on is set to TRUE, then a garbage collection is performed before each new object allocation.
- If on is set to FALSE, then a garbage collection is performed only when necessary to free memory.
Note that setting
gctorture to run can slow code execution considerably.
gctorture2 ignores all of its arguments and does nothing except to warn that is has not been implemented.
It always returns the integer zero. It is present only because a few packages refer to it in their test suites.
Value
returns a logical value: the previous gctorture() setting.
See Also
Examples
# Get the current value of the \code{gctorture()} setting:
gctorture(NA)
# Turn gctorture off:
gctorture(FALSE)
# Turn gctorture on:
gctorture(TRUE)