Closed pfrater closed 7 years ago
I've experienced the issue when running gadget.fit
several time in a session. Luckily I was not forced to a loop so my simple approach has been to close and open a new R session.
Not sure how much useful can be for this issue, but I've reported a similar one on an early version of Rgadget when using gadget.iterative
(see #42)
I've been advised and able to solve the issue at that time by using closeAllConnections()
, but apparently it doesn't seem to do the trick here
Could you try to use the mclapply function from multicore package, which creates a new R session for each item in the list?
This seemed to work once I took out closeAllConnections()
. Thanks
Also, on a side note. I believe multicore is now deprecated. I think it's been rolled together with snow into the parallel package.
That is true, I just confused the parallel package with multicore
I am having problems using
gadget.fit
in a loop (eitherlapply
orfor
loop) during, for example, fitting multiple bootstrap runs. The issue I am running into is thatgadget.fit
produces a number of connections when called, which can be seen withshowConnections(all = T)
. It shouldn't be too much of a hassle to just close these withcloseAllConnections()
embedded at the end of each iterations, but this tends to crash R for whatever reason.Has anyone else run into this issue? How did you deal with it? Perhaps we should consider implementing some sort of garbage collection within gadget.fit...