-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Potential memory problem in Rcpp? #547
Comments
I would be nice if you could mock it down to something not involved other dependencies -- if it really is just object creation then that should be possible. Barring that, can you try memory-profiling eg via msd <- mzR::openMSfile(f)
fullHead <- mzR::header(msd)
mzR::close(msd)
rm(msd) and the reported calling |
Thanks for your quick reply. I'll definitely try debugging with It is just strange that the errors appear when I create new S4 objects using |
|
mzR was by me more than two years ago. I will take a look at next week. |
I have spent several hours on this. In my personal opinion, this seems not about library(methods)
f <- system.file("microtofq/MM8.mzML", package = "msdata")
setClass("dummy",
slots = c(content = "character"),
prototype = prototype(
content = "none"
))
for (i in 1:5000) {
if (i %% 200 == 0) {
cat(i, "\n")
}
## open the file.
msd <- mzR::openMSfile(f)
fullHead <- mzR::header(msd)
mzR::close(msd)
rm(msd)
##gc()
process <- new("dummy", content = "something")
} |
Yes, that was also my conclusion. Thus I looked at the |
Shall we close this here then? |
yes, thanks for all your help! |
Sorry 'bout the bug. As I sometimes joke, friends don't let friends rely on S4 methods :) Maybe a small reproducible bug report could be sent to the BioBase / mzR side of things? |
this bug comes actually from MSnbase, went to mzR and ended here in Rcpp ;) the "fix" with the gc() call works for now, but when I find the time I'll dig deeper |
I will try to do that. Maybe we can find some interesting things by KK On 09/21/2016 10:41 AM, Dirk Eddelbuettel wrote:
|
Dear developers!
We have some randomly occurring errors in the
MSnbase
package (see issue lgatto/MSnbase#151) that I believe are somehow related with theRcpp
package. First, what makes me believe this is a memory problem is that a) it occurs randomly and b) it can be solved by a call togc()
. Why I believe it's related toRcpp
: inMSnbase
we use facilities from Bioconductor'smzR
package (https://github.com/sneumann/mzR) to read files.mzR
uses routines implemented in C++ to read these files.Based on how the errors are happening I have the feeling that memory is not cleaned up properly after calling the C++ functions.
In the example below we read the header of a file and create some objects after that. Note that the errors do not appear without the calls to
new
. Also, callinggc()
after eachrm(msd)
fixes the problem.I would be grateful for any hints how to solve this differently to calling
gc
after each import.All packages used are from Bioconductor, so you could grap them using
My
sessionInfo
:The text was updated successfully, but these errors were encountered: