Learn R Programming

memshare (version 1.1.0)

releaseVariables: Release variables from a shared memory namespace

Description

Delete variables from the shared memory space. Actual release occurs only when no active views remain.

Usage

releaseVariables(namespace, variableNames)

Value

Invisibly, TRUE on success.

Arguments

namespace

Character(1) used at registration time.

variableNames

Character vector of names to free.

Details

Registered buffers remain allocated until all views are released. If any worker still holds a view, releaseVariables cannot reclaim memory.

Thread safety

Registered buffers may be read concurrently by many processes. Concurrent writes must be synchronized externally (e.g., interprocess mutex). Do not call the R API from secondary threads.

Wrappers such as memApply / memLapply call this function on.exit.

See Also

registerVariables, releaseViews

Examples

Run this code
ns <- "example"
X <- matrix(rnorm(100), 10, 10)
registerVariables(ns, list(X = X))
# later ...
releaseVariables(ns, "X")

Run the code above in your browser using DataLab