Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upPossible memory leak with arma::sp_mat within Rcpp::List #89
Comments
|
Sorry, but what is your point? Are you obsessing over
If so, run some other R code and code. This is common as I recall. Also head the advice of
|
|
No, I'm not worried about
This is a small example (4 by 4 matrix), so when I use bigger matrices this number goes up (big time). Should I worry about this? |
|
Sorry, missed that. Sure. Better still, can you debug the sparse code in the one or two conversion headers? I wrote most of that as a one-off as I don't actually use sparse matrices ... |
|
Sure, happy to help (will do what I can as I still consider myself new to C++). Should I focus on https://github.com/RcppCore/RcppArmadillo/blob/master/inst/include/RcppArmadilloWrap.h#L80-L104 and https://github.com/RcppCore/RcppArmadillo/blob/master/inst/include/RcppArmadilloAs.h#L81-L119 ? |
|
FWIW I can confirm a leak is detected using the OS X Instruments 'Leak' instrument; I can help dig in later as well. |
|
Solved in #91 |
Hi, I don't know if this behavior is expected (I don't think so), but whenever I try to pass
dgCMatrixobjects within lists toRcppArmadilloviaarma::sp_matvalgrind catches a memory leak. Here is a minimal example in which I create a list with dense matricesarma::matand sparse matricesarma::sp_matThe code for
arma::sp_mat:And this is the output that I get from running
R -d valgrind --vanillaUsing "regular"
arma::matI get
For valgrind I'm using the following options:
Am I doing/gettin something wrong here?
Thanks