Skip to content
Prev 8074 / 10988 Next

[Rcpp-devel] R session crashes when largely using a Rcpp sourced function

Hello,

I have found out that the problem was in the R loop, the garbage  
collection of R wasn't perform efficiently. Indeed, when I force the  
garbage collection to be done, using R function gc(), the Rsession  
won't crash, although the execution of the loop will be slower.
This leads me to another question. Is there anyway to force the  
garbage collection inside a Rcpp function?
like this
NumericVector myfunction(NumericVector x){
    for(int= i = 0; i < x.size; ++i){
//do my stuff;
gc();
}
}

Thanks for any help!

Pierre Gloaguen

pgloague at ifremer.fr a ?crit?: