[Rcpp-devel] cxxfunplus

Silkworth,David J. SILKWODJ at airproducts.com
Tue Aug 21 18:47:19 CEST 2012


It is curious that just last night I gave up on a package development of some two months to regard a work-around requiring inline compilation for production activity.

I had then just discovered that the compiled objects returned NULL pointers when I tried to save the environment.

Now, I really don't want to live with the work-around.  But since waiting for compile only takes some extra seconds before a Gibbs sampler might take hours to run is not a reason to run out and assure I can save these inline compiled objects from run to run.

What happened seems that my functions written in Rcpp, and then direct called within, are not sending some release of memory notice back to R.  So that R keeps allocating only new memory for every iteration.  This causes an unnecessary race to the R memory limit very quickly.

It was found that functions compiled inline utilizing variables from R's global environment caused this memory problem to go away.  I really don't know why, but as a work-around I am now outside of a package, which is not where I want to be.

My example is a little too long to post on this list, but until I find a good way to place on a web location for download, I will offer to send by e-mail to anyone interested to explore this problem.
Not to be daunted, my inline code file is less than 300 lines.  I have some dependencies on a working package in development.  All told I have less than 300kb to send.





More information about the Rcpp-devel mailing list