I am using R 3.0.2 in Windows 7 64 bit. After running simulations with an output greater than about 100000
in length, if I use the mouse scroll wheel in the R console, Windows freezes indefinitely.
I once left it sitting for over a week with no response. Forcing shutdown is the only way out, and it does not register in Windows event log. I have tried to duplicate the issue in other programs, but it appears to occur only in R. I have tried several versions of R, uninstalled and reinstalled each, used several different computer mice and drivers, and even reinstalled Windows. Nothing has fixed the issue.
Some other common aspects that I can think of (but not yet certain are factors) are that
the simulations typically print iteration numbers, etc to the console during the simulation (using
flush.console()
for instance), andmemory use is high during (but not upon completion of) the simulation. Computer has 32GB RAM and two Intel Xeon E5-2687W CPUs (8-core, 3.1GHz).
An example that might cause this issue for me is:
foo<-function(X, SD, N, sims){
output<-vector("list")
for(i in 1:sims){
output[[i]]<-rnorm(N, X, SD)
flush.console()
cat(paste("Iteration", i, ":", "\n",
"mean = ", round(mean(output[[i]]),1), "\n",
"sd = ", round(sd(output[[i]]), 1), "\n"))
}
return(output)
}
result<-foo(X=20, SD=2, N=100, sims=100) # but increase N or sims to > 100000
# Now used the mouse scroll wheel in the R console. Computer freezes.
# Can also do rm(list=ls()) after the simulation, then use scroll wheel... Computer still freezes.