| releaseViews | R Documentation |
Given a namespace identifier (identifies the shared memory space to register to), this function releases retrieved views from the shared memory space.
NOTE: All views have to be free'd upon releasing the variable by the master.
releaseViews(namespace, variableNames)
namespace |
string of the identifier of the shared memory context. |
variableNames |
A character vector of variable names to delete. |
This is the only way to drop handles created by retrieveViews. Wrappers
such as memApply / memLapply call this function internaly. Not releasing views effectively
leaks the backing pages for the lifetime of the process.
No return value, called for deallocation of views.
Julian Maerte
retrieveViews, registerVariables
## Not run:
# MASTER SESSION:
# allocate data
## End(Not run)
n = 1000
m = 100
mat = matrix(rnorm(n * m), n, m) # target matrix
y = rnorm(n) # some other constant vector in which the function should not run
namespace = "ns_relview"
memshare::registerVariables(namespace, list(mat=mat, y=y))
## Not run:
# WORKER SESSION:
## End(Not run)
res = retrieveViews(namespace, c("mat", "y"))
## Not run:
# Perform your shared calculations here
## End(Not run)
releaseViews(namespace, c("mat", "y"))
## Not run:
# MASTER SESSION:
# free memory
## End(Not run)
memshare::releaseVariables(namespace, c("mat", "y"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.