tests/compare_allocator.R

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()
wush978/RcppAlloc documentation built on May 4, 2019, 12:01 p.m.