Closed kaneplusplus closed 8 years ago
library(bigmemory) library(doMC) registerDoMC(cores=2) a = big.matrix(nrow=3, ncol=3, shared=TRUE) desc = describe(a) foreach (i=1:3) %dopar% { m = attach.big.matrix(desc) m[i,1] = i NULL }
causes a shared memory resource leak. The following does not.
library(bigmemory) library(doMC) registerDoMC(cores=2) a = big.matrix(nrow=3, ncol=3, shared=TRUE) desc = describe(a) foreach (i=1:3) %dopar% { m = attach.big.matrix(desc) m[i,1] = i rm(m) gc() NULL }
causes a shared memory resource leak. The following does not.