-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible 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
dgCMatrix
objects within lists toRcppArmadillo
viaarma::sp_mat
valgrind catches a memory leak. Here is a minimal example in which I create a list with dense matricesarma::mat
and sparse matricesarma::sp_mat
The code for
arma::sp_mat
:And this is the output that I get from running
R -d valgrind --vanilla
Using "regular"
arma::mat
I get
For valgrind I'm using the following options:
Am I doing/gettin something wrong here?
Thanks
The text was updated successfully, but these errors were encountered: