Hello,

I encountered this problem while working on my Rcpp package. I don't know if it can be related to Rcpp, but I post it here looking for some advices. I'll try to make myself as clear as possible:

from an R function in my Rcpp package I call a C++ function where huge datasets (~ 2GB) are loaded in memory, parsed and used for computation. Clearly, every object and every data structure is handled on the C++ side. The computation advances successfully and produces a graph that is returned to R in terms of an edges list. On the R side I can use this list in many ways, but first it gets converted into a data.table, whose size is about 2MB. What is surprising is that the 'rsession' process keeps holding 3.2 GB of physical memory, as it can be easily checked with the 'top' command from shell. When I decide to run again the R function above, the rsession crashes soon afterwards, and this is likely due to a memory overflow (despite my PC has 8GB RAM).

it seems like the C++ function, once it terminates its execution, does not free the memory used. instead, rsession keeps holding these objects even though C++ has terminated. is it possible?


Thanks in advance,
Fabio
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to