It has been happening pretty often that while running Stan on RStudio, R crashes. I've not been able to discern a pattern other than "it often happens after I've used several Stan models in the same session," it's not consistent in what particular Stan models cause the error, nor what actions (sometimes it's calling the stan function, sometimes extract...). I'm trying to compare four models using 10-fold cross-validation (because the loo package has problems with the pareto-k-diagnostics all the time), but the loop never completes, and RStudio throws a fatal error and says a new R session should be started.
Any ideas what could be going on?