pboesu / rucrdtw

R Bindings for the UCR Suite for fast time series subsequence search
Other
15 stars 4 forks source link

Memory leak in ucrdtw_vv?! #8

Closed pboesu closed 7 years ago

pboesu commented 7 years ago

See https://github.com/pboesu/rucrdtw/issues/7#issuecomment-334476832 by @pfistfl : I am working on windows and therefore I can not really debug this, but when I run the following code:

gc()

library(rucrdtw)
set.seed(12444)
x = rnorm(10^4)
y = rnorm(10^4)
for (i in 1:10^4) ucrdtw_vv(x, y, dtwwindow = 0.01)

My rsession.exe starts to eat up more and more memory. (1.8GB of RAM each time I run the for loop). This slowly fills up the RAM and finally crashes the R-Session (or results in the following error:).

Error in ucrdtw_vv(x, y, dtwwindow = 0.01) : ERROR : Memory can't be allocated!!!

Even calling gc(reset = TRUE) does not free up the memory. Note, that no objects other than x and y are saved.

pboesu commented 7 years ago

found and plugged memory leak in ucrdtw_vv in https://github.com/pboesu/rucrdtw/commit/aa6b857cdf7f761c7939f012843b5bceee40e5f8

Remaining methods still need to be fixed and tested.

pboesu commented 7 years ago

Ok @pfistfl, the memory leaks should be fixed for all methods with https://github.com/pboesu/rucrdtw/commit/2956fe73989bbfd7aa81cb94627f6907b7b47e1f

If you can build from source ghit::install_github("pboesu/rucrdtw") should do the trick for now, if not let me know and I'll provide a Windows binary for you. I will try to get this update onto CRAN asap but this may take me another couple of days.

pboesu commented 7 years ago

Version 0.1.3 with these fixes has been accepted on CRAN. Binaries should be available in the coming days.