library(RcppAlloc)
# get_vmsize <- function() system(sprintf("cat /proc/%d/status | grep VmSize", Sys.getpid()))
gc()
# get_vmsize()
print("Get pointer of stl vector")
p <- get_stl_vec(10^9)
print("Check memory from R and from OS")
gc()
# get_vmsize()
print("Remove the object")
rm(p)
gc()
# get_vmsize()
gc()
# get_vmsize()
print("Get pointer of RAlloc vector")
p <- get_ralloc_vec(10^9)
print("Check memory from R and from OS")
gc()
# get_vmsize()
print("Remove the object")
rm(p)
gc()
# get_vmsize()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.