Saving edited .rstan files taking long time

Hi, I noticed that whenever I open the .rstan files on Rstudio (particularly when I attempt to edit and save it), the Rstudio becomes sluggish. Saving .rstan files take more than 10 sec, which is unique to those files. Model estimation and other functions seem to be working fine. Could you please help me to resolve this issue?

I am using:
rstan “2.21.0”
R version 4.0.3 (2020-10-10)
Rstudio 1.4.1056 Wax Begonia
macOS mojave 10.14.6

Thank you.

I’ve been experiencing something similar on linux and suspect it’s an issue with Rstudio. Do you still get the stalls if you uncheck the “check syntax on save” box?
Screenshot from 2020-12-21 18-44-53

Yes, it is still slow even when the “check syntax on save” box is unchecked. But, I am glad to know that I am not the only person having this issue.

May it be Rstudio problem? I recently updated it to the latest version and started having a similar issue. It sometimes takes me around 10s to save the modification of a .stan file. I had even R crash while saving .stan file. What even worse is after fitting the model, R crash randomly when exporting samples or plotting the posterior. I thought it’s Windows issues, seems Mac also get this. There are many posts on Rstuido forum, but hard to find a solution.

1 Like

Yup, it was an RStudio thing that’s been fixed in the recent RStudio Dailies.

3 Likes

Thanks a lot. May I ask if this also solve the crashing issue not just for calling diagnosis many times while saving a .stan file? It would be great if it does.

Just to update, I’ve been using nightly build Rstudio with Stan the whole day today and did not have any crashes. Saving stan file just take instance as usual. Hopefully, a stable version of Rstudio would be released soon. Thanks a lot.

1 Like

Hi @mike-lawrence, sorry I am back. This issue just comes back after I updated rstan since I need some math functions in the new release. It’s now so painful to write a stan model, as long as I write more than around 10 new lines, Rstudio will crash. And the saving time for the stan code will also take longer up to around 10s while I am approaching the crash point.

What I noticed is that the memory usage can go up to ~1.5GiB while I am only modifying the stan code and nothing is loaded in the environment. Seems Rstudio is automatically saving the code with a certain frequency. Could you please help?

Best to ask the rstudio folks here

Oh my apologize, I thought you are one of them :)

1 Like