viewList: Function to obtain a list of the views the current session...

View source: R/viewList.R

viewListR Documentation

Function to obtain a list of the views the current session holds.

Description

When your current session has retrieved views of shared memory via retrieveViews internally the view is tracked until it is released via releaseViews.

This function serves as a tool to check whether all views have been free'd after usage or to see what views are currently available to the session.

Usage

  viewList()

Details

The string of each element of the output list has the format <namespace name>.<variable name>. Default is lokal environment.

Useful for leak diagnostics: if releaseVariables did not free memory, check that viewList() is empty across all sessions.

Value

An 1:p list of characters of the the p retrieved views

Note

For windows we prepend the namespace identifier by "Local\\" because otherwise the shared memory is shared system-wide (instead of user-wide) which needs admin privileges.

Author(s)

Julian Maerte

See Also

retrieveViews, releaseViews

Examples

  ## Not run: 
  # MASTER SESSION:
  
## End(Not run)
  mat = matrix(0,5,5)
  registerVariables("ns_viewL", list(mat=mat))

  ## Not run: 
  # WORKER SESSION:
  
## End(Not run)
  viewList() # an empty list to begin with (no views retrieved)

  matref = retrieveViews("ns_viewL", c("mat"))
  viewList() 
  ## Not run: # now equals c("ns_viewL.mat")

  releaseViews("ns_viewL", c("mat"))
  viewList() 
  ## Not run: 
  # an empty list again
  
  # MASTER SESSION:
  
## End(Not run)
  releaseVariables("ns_viewL", c("mat"))

memshare documentation built on Dec. 5, 2025, 9:07 a.m.