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

2014-10-07 Thread Pierre . Gloaguen
Hello Jonathan, Thanks a lot for your help. I didn't know valgrind, but i'll definitely go into it. Thanks very much for your help. So, you think I should go to postfix increments instead of prefix? I'm a beginner in C++, so I'm not comfortable on which of them to chose. You seem to be righ

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

2014-10-07 Thread Jonathan Olmsted
Pierre, Have you used a tool like Valgrind? There is a bit of a learning curve, but it is exceedingly useful. A few comments: 1) For cases likes this gctortute(TRUE) in your R script helps those “for enough iterations in a loop…” bugs to present quickly. With gctorture(TRUE) I’m producing the cr

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

2014-10-07 Thread Dirk Eddelbuettel
Hi Pierre, On 8 October 2014 at 01:59, [email protected] wrote: | I will do what I can to reduce the code and have to same error occuring. | Of course i don't expect you to read all of it :) I was just wondering | if that kind of memory problem occured before, and if has some | "typi

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

2014-10-07 Thread Pierre . Gloaguen
Hello Dirk, I will do what I can to reduce the code and have to same error occuring. Of course i don't expect you to read all of it :) I was just wondering if that kind of memory problem occured before, and if has some "typical/generic" solutions. I will try to have a shortest code to exhibi

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

2014-10-07 Thread Dirk Eddelbuettel
On 8 October 2014 at 01:20, [email protected] wrote: | Hello Dirk, and everyone, | | I sadly was too optimistic thinking that a gc() would solve the problem. | The main_function_C I wrote was putted in a more general function | named simu_cond_ea_C [...] | Any clue about the origin of

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

2014-10-07 Thread Pierre . Gloaguen
Hello Dirk, and everyone, I sadly was too optimistic thinking that a gc() would solve the problem. The main_function_C I wrote was putted in a more general function named simu_cond_ea_C List simu_cond_ea_C(arma::vec X0,arma::vec XF, double t0, double tF, NumericVector time